A
A
Alexey2015-02-16 16:20:49
PHP
Alexey, 2015-02-16 16:20:49

How to track the success of HTTP response delivery?

There is a need to know in PHP whether the client received the content of the HTTP response. I do not quite understand how apache behaves if I received a request, there was a break and the client did not receive a response. May I know about it? What happens to the Apache at this moment?
There is an API, according to which they make a request for actions to me. I make them and give the answer. But there is some delay before the response and I need to know for sure that I delivered the response. This is a hypothetical situation, but it is close to real.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Armenian Radio, 2015-02-16
@gbg

The only reliable way to ensure that the client side has received and processed the response is to program the client side to send an acknowledgment.
Because there is a non-zero probability that the client side will fall off at the moment when the data transfer over HTTP has already been completed, but the data has not actually been received by the client.

F
fuzzdrive, 2015-02-16
@fuzzdrive

req ->
<- ans
ok ->
<- ok ?

A
Alexander Kubintsev, 2015-02-17
@akubintsev

You have a serious complication in the task - to save the existing transaction mechanism.
Of course, it would be most correct to send a request to the server to generate an empty transaction id, and then work with it. But since, according to the conditions of the problem, this can no longer be done, only crutches remain.
Neither apache nor nginx will answer you about the fate of the package in a bad connection. All you can do in this situation is to register an event pending confirmation of the operation and wait for the corresponding request from the client to close with a sign of success or vice versa in case of a timeout.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question