Commit be8040e3 authored by Alexander.Trofimov's avatar Alexander.Trofimov

add _reconnect function to DocsCoApi

parent ce044466
......@@ -1666,19 +1666,21 @@
this._tryReconnect();
}
};
DocsCoApi.prototype._tryReconnect = function() {
var t = this;
if (this.reconnectTimeout) {
clearTimeout(this.reconnectTimeout);
t.reconnectTimeout = null;
}
++this.attemptCount;
this.reconnectTimeout = setTimeout(function() {
delete t.sockjs;
t._initSocksJs();
}, this.reconnectInterval);
};
DocsCoApi.prototype._reconnect = function () {
delete this.sockjs;
this._initSocksJs();
};
DocsCoApi.prototype._tryReconnect = function () {
var t = this;
if (this.reconnectTimeout) {
clearTimeout(this.reconnectTimeout);
t.reconnectTimeout = null;
}
++this.attemptCount;
this.reconnectTimeout = setTimeout(function () {
t._reconnect();
}, this.reconnectInterval);
};
DocsCoApi.prototype._getDisconnectErrorCode = function(opt_closeCode) {
if (c_oCloseCode.serverShutdown === opt_closeCode) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment