diff --git a/src/index.ts b/src/index.ts index aa858dd..894ff19 100644 --- a/src/index.ts +++ b/src/index.ts @@ -98,6 +98,10 @@ export class SwarmClient extends Client { this._sockets.delete(socketId); }); + if (!this._sockets.has(socketId)) { + this._sockets.set(socketId, socket); + } + this.emit("connection", socket); } );