Closed alessandrocapra closed 6 years ago
I guess that there's a timeout is set when the device connects to the server. I took a look at the library code but didn't find anything related.
Are you disconnected after 1 minute of inactivity? If this is the case, the probable cause is the timeout.
A possible workaround should be a routine that exchanges "keep alive" messages with the server every 30 seconds, for example...
hi,
Yes, the server will kill the connection without a keepalive. I havent had much time but I'm planning on adding that to the next release
A possible workaround should be a routine that exchanges "keep alive" messages with the server every 30 seconds, for example...
Yep, actually that's what it was! I checked the code and I tried to call the monitor() function every 30 seconds, because I saw that there is an handshake in place there and it seems to be working! So basically I just have it running every 30secs and sending an emit event to the server, that's it.
Btw @washo4evr I cannot thank you enough for your efforts in this library, I'm using it for my Master's thesis and it's been super helpful! If I can help somehow to improve it you definitely deserve that help :)
Hello, as in the title the connection works just fine, but after approximately a minute the connection with socketIO on the nodeJS server is lost, with the client apparently sending the disconnect message to the server.
How could I debug this? The client.monitor() does not show any disconnect message.
Thanks!