spogulis no
https://git.coolaj86.com/coolaj86/telebit.js.git
synced 2025-06-30 17:06:31 +00:00
Added support for onOpen/onClose/onDisconnect/onReconnect handlers
Šī revīzija ir iekļauta:
vecāks
7d1c553149
revīzija
9dccf5b022
@ -434,11 +434,10 @@ function _connect(state) {
|
||||
} else if (state.handlers.onReconnect && !initialConnect) {
|
||||
state.handlers.onReconnect();
|
||||
}
|
||||
intitialConnect = false;
|
||||
initialConnect = false;
|
||||
}
|
||||
|
||||
, onClose: function () {
|
||||
console.log('ON CLOSE');
|
||||
clearTimeout(timeoutId);
|
||||
wstunneler = null;
|
||||
clientHandlers.closeAll();
|
||||
@ -474,17 +473,15 @@ function _connect(state) {
|
||||
state.handlers.onClose()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
, onError: function (err) {
|
||||
console.error("[tunnel error] " + err.message);
|
||||
console.error(err);
|
||||
|
||||
if (connCallback) {
|
||||
connCallback(err);
|
||||
console.error("[tunnel error] " + err.message);
|
||||
console.error(err);
|
||||
if (connCallback) {
|
||||
connCallback(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
, sendMessage: function (msg) {
|
||||
if (wstunneler) {
|
||||
|
Notiek ielāde…
x
Atsaukties uz šo jaunā problēmā
Block a user