HTTP server detecting a broken network connection from a HTTP client

前端 未结 2 466
忘掉有多难
忘掉有多难 2021-01-24 05:21

I have an web application in which after making a HTTP request to the server, the client quits ( or network connection is broken) before the response was completely received by

2条回答
  •  别那么骄傲
    2021-01-24 06:10

    No, there is nothing built in to the protocol to do this (after all, you can't tell whether the response has been received by the client itself yet, or just a downstream proxy).

    Just have your client make a second request to acknowledge that it has received and stored the original response. If you don't see a timely acknowedgement, run the cleanup.

    However, make sure that you understand the implications of the Two Generals' Problem.

提交回复
热议问题