admin管理员组文章数量:1306875
We're doing some heavy computing on our server and want to make sure we don't do too much work if the client has already lost interest and closed the connection. According to AI there are two ways to detect if a http connection (or tcp for that matter, as http is stateless) has disconnected:
- TCP connection close: Peer sends a TCP connection reset packet
- Keepalive mechanism: Server starts sending keepalive packets to the client to check if the connection is still alive.
Now I get number 2) but I don't get 1). It seems that a connection reset
is usually only sent by the server side, is that correct? Or will it also be sent by http clients like for example pythons requests
library or your favorite internet browser? What happens if I abort said python program or if my computer crashes? Will the server get a connection reset or will I have to fallback to mechanism number 2)?
本文标签: How to detect on server when a http client disconnectsStack Overflow
版权声明:本文标题:How to detect on server when a http client disconnects - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741832264a2400002.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论