Client disconnection
Posted: Mon Jan 04, 2010 9:59 am
Hi all,
I use a PHP server (P) with which I'd like to do XML over HTTP communication with an other server running J2EE (J).
The communication protocol is the following :
J sends a post request to P. P responds with some "echo" to J (OK or NOK for a xml problem for example). If the response is transmitted to J, P process this request. Otherwise P cancels the request and J will resend its request.
So the HTTP request and response are done in the same TCP session.
My problem is that even if the connection is down and P echo the response, P doesn't see that the connection is down and so can't cancel the process to wait the next request from J.
I test to detect that with the connection_aborted function in the register_shutdown_function. However even with flushing the echo this solution doesn't seem to work.
Thus I'd like to know if there is a way to know if the client is still connected when I echo something from the PHP server.
I thought to get the output stream as one can do in Java but I don't find anything to carry out this.
Thanks a lot in advance for any help
Nocia
I use a PHP server (P) with which I'd like to do XML over HTTP communication with an other server running J2EE (J).
The communication protocol is the following :
J sends a post request to P. P responds with some "echo" to J (OK or NOK for a xml problem for example). If the response is transmitted to J, P process this request. Otherwise P cancels the request and J will resend its request.
So the HTTP request and response are done in the same TCP session.
My problem is that even if the connection is down and P echo the response, P doesn't see that the connection is down and so can't cancel the process to wait the next request from J.
I test to detect that with the connection_aborted function in the register_shutdown_function. However even with flushing the echo this solution doesn't seem to work.
Thus I'd like to know if there is a way to know if the client is still connected when I echo something from the PHP server.
I thought to get the output stream as one can do in Java but I don't find anything to carry out this.
Thanks a lot in advance for any help
Nocia