buffet: XmppChannel listens for connectivity changes
ShillClent provides notifications for network changes.
XmppChannel issue XMPP ping on every network change and restart if
failed. Only exception is soon scheduled upcoming reconnect.
BUG=brillo:1139
TEST=register device, disconnect network, wait device is offline in
GCD dashboard, connect network.
Dashboard should show device as online in less then 60 seconds.
Change-Id: I73dffc54400777b2325c26fb8aaf259b515174ce
Reviewed-on: https://chromium-review.googlesource.com/281413
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Vitaly Buka <vitalybuka@chromium.org>
Tested-by: Vitaly Buka <vitalybuka@chromium.org>
diff --git a/buffet/notification/xmpp_iq_stanza_handler.h b/buffet/notification/xmpp_iq_stanza_handler.h
index 0eb0900..2583e90 100644
--- a/buffet/notification/xmpp_iq_stanza_handler.h
+++ b/buffet/notification/xmpp_iq_stanza_handler.h
@@ -45,6 +45,16 @@
const ResponseCallback& response_callback,
const TimeoutCallback& timeout_callback);
+ // |timeout| is the custom time interval after which requests should be
+ // considered failed.
+ void SendRequestWithCustomTimeout(const std::string& type,
+ const std::string& from,
+ const std::string& to,
+ const std::string& body,
+ base::TimeDelta timeout,
+ const ResponseCallback& response_callback,
+ const TimeoutCallback& timeout_callback);
+
// Processes an <iq> stanza is received from the server. This will match the
// stanza's 'id' attribute with pending request ID and if found, will
// call the |response_callback|, or if the request is not found, an error