Why setting a client-side timeout when using long polling?

喜欢而已 提交于 2019-12-10 14:43:54

问题


In almost every long polling examples I see, there is something like a timeout of 30 seconds client-side. What is the precise reason for this?


回答1:


Some routers, proxies or whatever device there is in the middle might decide to drop TCP/IP connections being idle for extensive period of time. Also refreshing connection once in a while makes sure you'll discover server failure quicker.



来源:https://stackoverflow.com/questions/14903223/why-setting-a-client-side-timeout-when-using-long-polling

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!