*Update dist
This commit is contained in:
parent
7980aa29c7
commit
b1ad8399d3
|
@ -23,7 +23,7 @@ export default class Socket extends Duplex {
|
||||||
constructor({ allowHalfOpen, remoteAddress, remotePort, remotePublicKey, write, emulateWebsocket, }?: SocketOptions);
|
constructor({ allowHalfOpen, remoteAddress, remotePort, remotePublicKey, write, emulateWebsocket, }?: SocketOptions);
|
||||||
private _connecting;
|
private _connecting;
|
||||||
get connecting(): boolean;
|
get connecting(): boolean;
|
||||||
get readyState(): string;
|
get readyState(): string | number;
|
||||||
listen(): void;
|
listen(): void;
|
||||||
setTimeout(msecs: any, callback: any): void;
|
setTimeout(msecs: any, callback: any): void;
|
||||||
_onTimeout(): void;
|
_onTimeout(): void;
|
||||||
|
|
|
@ -37,6 +37,17 @@ class Socket extends streamx_1.Duplex {
|
||||||
return this._connecting;
|
return this._connecting;
|
||||||
}
|
}
|
||||||
get readyState() {
|
get readyState() {
|
||||||
|
if (this._emulateWebsocket) {
|
||||||
|
if (this._connecting) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else if (this.readable && this.writable) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (this._connecting) {
|
if (this._connecting) {
|
||||||
return "opening";
|
return "opening";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue