add reconnect debug lines
This commit is contained in:
parent
ed97f6648d
commit
0ad4cd4f7e
|
@ -44,6 +44,7 @@ class Network extends EventEmitter<INetworkEvents> {
|
|||
{
|
||||
autoConnect: false,
|
||||
withCredentials: true,
|
||||
reconnection: true,
|
||||
}
|
||||
);
|
||||
private online_count = 0;
|
||||
|
@ -72,6 +73,22 @@ class Network extends EventEmitter<INetworkEvents> {
|
|||
this.emit("disconnected");
|
||||
});
|
||||
|
||||
this.socket.io.on("reconnect", (attempt) => {
|
||||
console.log("Reconnected to server on attempt " + attempt);
|
||||
});
|
||||
|
||||
this.socket.io.on("reconnect_attempt", (attempt) => {
|
||||
console.log("Reconnect attempt " + attempt);
|
||||
});
|
||||
|
||||
this.socket.io.on("reconnect_error", (err) => {
|
||||
console.log("Reconnect error", err);
|
||||
});
|
||||
|
||||
this.socket.io.on("reconnect_failed", () => {
|
||||
console.log("Reconnect failed");
|
||||
});
|
||||
|
||||
this.socket.on("user", (user: AuthSession) => {
|
||||
this.emit("user", user);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue