Compare commits

..

No commits in common. "35bf05c25ec48099017a35b9c7953a8e38f6c24a" and "c3c8e6fb3b22e615815f39b0b3b14eee2c2384c7" have entirely different histories.

3 changed files with 5 additions and 3 deletions

View File

@ -25,7 +25,7 @@ export default class MultiSocketProxy extends Proxy {
handleClosePeer(peer: Peer): Promise<void>; handleClosePeer(peer: Peer): Promise<void>;
get(pubkey: Uint8Array): PeerEntity | undefined; get(pubkey: Uint8Array): PeerEntity | undefined;
update(pubkey: Uint8Array, data: Partial<PeerEntity>): void; update(pubkey: Uint8Array, data: Partial<PeerEntity>): void;
createSocket(options: TcpSocketConnectOpts): typeof this.socketClass; createSocket(options: TcpSocketConnectOpts): Promise<typeof this.socketClass>;
private _registerOpenSocketMessage; private _registerOpenSocketMessage;
private _registerWriteSocketMessage; private _registerWriteSocketMessage;
private _registerCloseSocketMessage; private _registerCloseSocketMessage;

View File

@ -136,7 +136,7 @@ class MultiSocketProxy extends proxy_js_1.default {
}, },
}); });
} }
createSocket(options) { async createSocket(options) {
if (!this._peers.size) { if (!this._peers.size) {
throw new Error("no peers found"); throw new Error("no peers found");
} }

View File

@ -172,7 +172,9 @@ export default class MultiSocketProxy extends Proxy {
} as PeerEntity); } as PeerEntity);
} }
public createSocket(options: TcpSocketConnectOpts): typeof this.socketClass { public async createSocket(
options: TcpSocketConnectOpts
): Promise<typeof this.socketClass> {
if (!this._peers.size) { if (!this._peers.size) {
throw new Error("no peers found"); throw new Error("no peers found");
} }