joewalnes / reconnecting-websocket

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

how to use these methods? #109

Open doubleLLL3 opened 4 years ago

doubleLLL3 commented 4 years ago

There is no change when I use the method refresh() by ws.refresh() when they weren't connected. Why? And when they have been connected, they would just be disconnected and never connect again.. var ws = new ReconnectingWebSocket('ws://localhost:8866/view_tool'); $("#btn_reconnect").click(function(){ ws.refresh(); });

doubleLLL3 commented 4 years ago

Finally, I use the method ws.open() to reconnect. But I still don't know why refresh() can't work.