Hi, I have a web application (.war file) running under *apache-tomcat-7.0.52*. It is a proxy application between my c++ client and server apps. Once HTTP request (from the client) is received by web application, it propagates request to the server and sends response back to the client once it is ready. Server may need long time before it produces some data to send to the client (also it can send data by chunks with really long delays etc.).
My question is. *Is there a way to detect client disconnect before the time server has something ready to be written to the output stream?* In case if server writes something after client's disconnect, obviously I will get an exception and can handle it properly. But my goal is to avoid waiting for the server to produce some data to write, to detect this. I saw a couple of forums and mailing lists where people say that only way to do this, is by writing to outputstream. But in case of websockets I know that I can get notifications that connection was closed by the client. I believe this is a very common issue people face and there should be a graceful solution for this for HTTP as well. Can you please advice ? Thank you, -Grigor -- ------------------------------ *CONFIDENTIALITY NOTE:* THIS E-MAIL MESSAGE AND ANY ATTACHMENTS MAY CONTAIN CONFIDENTIAL AND PRIVILEGED INFORMATION OF ONEMARKETDATA, LLC. IT IS FOR THE SOLE USE OF THE INTENDED RECIPIENT(S) AND ANY UNAUTHORIZED REVIEW, USE, COPYING OR DISCLOSURE IS PROHIBITED. IF YOU ARE NOT THE INTENDED RECIPIENT, PLEASE CONTACT THE SENDER IMMEDIATELY BY REPLY E-MAIL OR BY TELEPHONE AT +1 201 710 5977, AND DESTROY ALL COPIES OF THIS MESSAGE FROM YOUR SYSTEM. E-SIGNATURE NOTICE: Unless specifically set forth herein, the transmission of this communication is not intended to be a legally binding electronic signature, and no offer, commitment or assent on behalf of OneMarketData, LLC is expressed or implied by the sending of this email, or any attachments hereto.