*Put _nextPeer into the constructor
This commit is contained in:
parent
35bf05c25e
commit
b04db8668b
|
@ -89,9 +89,10 @@ export default class MultiSocketProxy extends Proxy {
|
||||||
await conn.init();
|
await conn.init();
|
||||||
this.emit("peer", conn);
|
this.emit("peer", conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
private socketClass: any;
|
private socketClass: any;
|
||||||
private _peers: Map<string, PeerEntity> = new Map<string, PeerEntity>();
|
private _peers: Map<string, PeerEntity> = new Map<string, PeerEntity>();
|
||||||
private _nextPeer = roundRobinFactory(this._peers);
|
private _nextPeer;
|
||||||
private _server = false;
|
private _server = false;
|
||||||
private _allowedPorts = [];
|
private _allowedPorts = [];
|
||||||
|
|
||||||
|
@ -109,6 +110,7 @@ export default class MultiSocketProxy extends Proxy {
|
||||||
if (options.server) {
|
if (options.server) {
|
||||||
this._server = true;
|
this._server = true;
|
||||||
}
|
}
|
||||||
|
this._nextPeer = roundRobinFactory(this._peers);
|
||||||
}
|
}
|
||||||
|
|
||||||
private _socketMap = new Map<number, number>();
|
private _socketMap = new Map<number, number>();
|
||||||
|
|
Loading…
Reference in New Issue