Loading packages/client/src/lib/network.ts +17 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ class Network extends EventEmitter<INetworkEvents> { { autoConnect: false, withCredentials: true, reconnection: true, } ); private online_count = 0; Loading Loading @@ -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 Loading
packages/client/src/lib/network.ts +17 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ class Network extends EventEmitter<INetworkEvents> { { autoConnect: false, withCredentials: true, reconnection: true, } ); private online_count = 0; Loading Loading @@ -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