cordova-plugin-websocket-server icon indicating copy to clipboard operation
cordova-plugin-websocket-server copied to clipboard

Reconnecting clients after server app is closed

Open flockf opened this issue 4 years ago • 2 comments

Hi all,

I want to ask about the following issue:

When the server app that uses this plugin is closed, the clients that are connected at the time get a 1006 error. Then, after the server app is restarted the clients can't connect back again, and keep receiving the same error code.

Does anyone know how can the clients connect back without getting that error? I have tried to get the server to close connections by detecting beforeunload, but it is not working.

Any help will be really appreciated

Thanks.

flockf avatar Jul 02 '20 15:07 flockf

Hello, Do you bind the server to a specific port ? If yes, maybe that port is not freed up.

becvert avatar Jul 05 '20 13:07 becvert

@becvert Sorry for the late reply. I haven't been active in this account for a while. The issue seemed to be fixed using setReuseAddr(true). Thanks

flockf avatar Aug 11 '21 21:08 flockf