开发者

detecting server crash during long-polling http request

I have a Java client that uses HttpClient to connect to a server and wait a response. The response may return after a long time (the client essentially waits for an event from the server).

Other than using timeouts, is there a way to detect w开发者_如何学Chen the server crashes?


Considering that a server which has "crashed" cannot be relied upon to send you a message indicating that it has crashed, no.

The solution is to use a timeout, to set an upper limit on the amount of time your client is willing to wait for a request.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜