From b04db8668bf4d1629b5682d02b36c3c8634b4f93 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 16 Apr 2023 05:48:32 -0400 Subject: [PATCH] *Put _nextPeer into the constructor --- src/proxies/multiSocket.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/proxies/multiSocket.ts b/src/proxies/multiSocket.ts index 137a83e..85064b6 100644 --- a/src/proxies/multiSocket.ts +++ b/src/proxies/multiSocket.ts @@ -89,9 +89,10 @@ export default class MultiSocketProxy extends Proxy { await conn.init(); this.emit("peer", conn); } + private socketClass: any; private _peers: Map = new Map(); - private _nextPeer = roundRobinFactory(this._peers); + private _nextPeer; private _server = false; private _allowedPorts = []; @@ -109,6 +110,7 @@ export default class MultiSocketProxy extends Proxy { if (options.server) { this._server = true; } + this._nextPeer = roundRobinFactory(this._peers); } private _socketMap = new Map();