Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i am working on chat application (using rocket.chat)

in this my web socket is closed after 1 minute if i not do anything.

What I have tried:

i not got any solution.
give me any idea if any one have !
Posted
Updated 13-Sep-17 1:05am
Comments
Afzaal Ahmad Zeeshan 13-Sep-17 6:36am    
Check the documentation to see how the elongate the session time out.
Jaydeep Shah 13-Sep-17 6:51am    
not seession time out ! it's websocket.

1 solution

Web Sockets have an idle timeout of 60 seconds: if you do not use a heartbeat or similar via ping and pong frames then the socket assumes that the user has closed the page and closes the socket to save resources.

In theory, you can get round this by disabling the timeout, but that may be prevented by local rules and is a very bad idea anyway.
Either keep the socket alive by using it, or open and close it when you need it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900