为什么在使用长轮询时设置客户端超时? [英] Why setting a client-side timeout when using long polling?

查看:260
本文介绍了为什么在使用长轮询时设置客户端超时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我看到的几乎所有长轮询示例中,都有30秒客户端超时的情况.确切的原因是什么?

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?

推荐答案

中间的某些路由器,代理或任何设备可能会决定断开长时间处于空闲状态的TCP/IP连接.还会不时刷新连接,以确保您更快地发现服务器故障.

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.

这篇关于为什么在使用长轮询时设置客户端超时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆