diff --git a/index.js b/index.js index 9da0130..a4defa4 100644 --- a/index.js +++ b/index.js @@ -60,7 +60,7 @@ const DAD = (module.exports = class RpcSocket extends ws { } reconnectAsync(url) { - if (this.readyState < ws.CLOSING) { + if (this.readyState === ws.CONNECTING || this.readyState === ws.OPEN) { return Promise.resolve(this) } return new Promise((resolve, reject) => {