socket: Add comment about the close() call in _try_to_reconnect()

(imported from commit 87e32adcb9eeb066b6f3ecd85550d00263e0a4e9)
This commit is contained in:
Zev Benjamin
2014-01-30 14:30:49 -05:00
committed by Steve Howell
parent b8444daddd
commit 9020f37141

View File

@@ -308,6 +308,9 @@ Socket.prototype = {
this._is_authenticated = false; this._is_authenticated = false;
this._is_reconnecting = true; this._is_reconnecting = true;
this._reconnect_initiation_time = now; this._reconnect_initiation_time = now;
// This is a little weird because we're also called from the SockJS
// onclose handler. Fortunately, close() does nothing on an
// already-closed SockJS object.
this._sockjs.close(); this._sockjs.close();
this._reconnect_timeout_id = setTimeout(function () { this._reconnect_timeout_id = setTimeout(function () {