문제

As this question, In code.google.com/p/go.net/websocket, it needs to implement keep-alive by self.

So what is proper time span that web-socket to keep alive? Thanks!

도움이 되었습니까?

해결책

Generally keeping the keep-alive just under 60 seconds is good idea. (Heroku for instance requires you to send some data at least every 55 seconds) So sending a ping/pong every 50 seconds should keep your connection alive. Do note that you might have to choose a shorter interval depending on your server stack, any web accelerators, proxies and caches. A NAT router also influences the interval. Most of the time 50 seconds will work but 25 seconds usually does the trick when 50 doesn't.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top