Compare commits
2 Commits
9c1bedc83e
...
4cd89acb12
Author | SHA1 | Date |
---|---|---|
Derrick Hammer | 4cd89acb12 | |
Derrick Hammer | 794ab2f792 |
|
@ -75,7 +75,7 @@ export class SwarmClient extends Client {
|
||||||
async _listen() {
|
async _listen() {
|
||||||
if (!this._connectionListener) {
|
if (!this._connectionListener) {
|
||||||
this._connectionListener = this.connectModule("listenConnections", { swarm: this.swarm }, async (socketId) => {
|
this._connectionListener = this.connectModule("listenConnections", { swarm: this.swarm }, async (socketId) => {
|
||||||
const socket = this._sockets.get(socketId) ?? (await createSocket(socketId));
|
const socket = this._sockets.get(socketId) ?? (await createSocket(socketId, this));
|
||||||
socket.on("close", () => {
|
socket.on("close", () => {
|
||||||
this._sockets.delete(socketId);
|
this._sockets.delete(socketId);
|
||||||
});
|
});
|
||||||
|
|
|
@ -107,7 +107,7 @@ export class SwarmClient extends Client {
|
||||||
{ swarm: this.swarm },
|
{ swarm: this.swarm },
|
||||||
async (socketId: any) => {
|
async (socketId: any) => {
|
||||||
const socket =
|
const socket =
|
||||||
this._sockets.get(socketId) ?? (await createSocket(socketId));
|
this._sockets.get(socketId) ?? (await createSocket(socketId, this));
|
||||||
|
|
||||||
socket.on("close", () => {
|
socket.on("close", () => {
|
||||||
this._sockets.delete(socketId);
|
this._sockets.delete(socketId);
|
||||||
|
|
Loading…
Reference in New Issue