joewalnes / reconnecting-websocket

A small decorator for the JavaScript WebSocket API that automatically reconnects
MIT License
4.21k stars 968 forks source link

added waitForConnection method #68

Open akiraz opened 8 years ago

akiraz commented 8 years ago

Firstly thanks for the reconnecting-websocket.js. While I'm using it on my project , I am getting "Still in CONNECTING state " error intermittently. To solve this issue , I added a method named as waitForConnection(). Before ws.send method executes , connection state must be 1 , otherwise Still in CONNECTING state error is thrown.