node-json-socket
node-json-socket copied to clipboard
connection don´t close when server program stopped
Hi,
just encountered a strange problem:
I have a server-client connection via json-socket. Communication is running fine. I added on client side a method to connect again to server once the "close" event or "error" event has raised. The connection establish again but now i receive the packets twice on client side. I can reproduce this and each time i stopp and restart the server, the number of received packages increase by one. I added a destroy function to the json-socket but this don´t help. Any suggestions?
KR Solick
I tried a couple of thinks and finally found out, that the message event will not be deregistrated somehow. Making sure, that the message event will only be registered one (eg. by setting a flag) solves my problem. But i´m not sure if this is a bug or a feature ;)