Bug 855906 - SimplePush: Set pingInterval on websocket. r=dougt

This commit is contained in:
Jason Duell 2013-04-05 13:52:24 -07:00
parent c9c0f8d58c
commit 3c0ce1c33a
2 changed files with 3 additions and 0 deletions

View File

@ -395,6 +395,8 @@ pref("services.push.serverURL", "");
pref("services.push.userAgentID", "");
// exponential back-off start is 5 seconds like in HTTP/1.1
pref("services.push.retryBaseInterval", 5000);
// WebSocket level ping transmit interval in seconds.
pref("services.push.websocketPingInterval", 55);
// exponential back-off end is 20 minutes
pref("services.push.maxRetryInterval", 1200000);
// How long before a DOMRequest errors as timeout

View File

@ -567,6 +567,7 @@ PushService.prototype = {
debug("serverURL: " + uri.spec);
this._wsListener = new PushWebSocketListener(this);
this._ws.protocol = "push-notification";
this._ws.pingInterval = this._prefs.get("websocketPingInterval");
this._ws.asyncOpen(uri, serverURL, this._wsListener, null);
this._currentState = STATE_WAITING_FOR_WS_START;
},