Vineet Kumar
Vineet Kumar

Reputation: 187

Socket connection disconnects automatically

I am implementing the socket connection for video calling and chat. I am using react-native for client and I use socket.io-client v.2.1.0 and socket.io v.2.1.1 on node server. The socket connection gets established successfully when I open the application but when I lock the phone or the phone sleeps then the socket connection gets disconnected automatically after some time.

Please help me out!

Upvotes: 1

Views: 4504

Answers (1)

Tudor
Tudor

Reputation: 318

Take a look at the pingTimeout argument in the socketio docs here. Set it to a really high number so the socket doesn't timeout.

Upvotes: 3

Related Questions