I am using a long poll HTTP connection using a Java servlet.
How can I find out that the http client is still active anyway? I am currently doing this to write a byte to the output stream and dump the data. If there is an IO exception, then the client is dead.
But in ASP.NET, there is the Response.IsClientConnected property, which can find out if the client is active without writing anything to the output stream.
I want to know how you can develop in a Java servlet. I do not want to write data to the HTTP response stream, as it can cost the network.
Thanks in advance.
PC.
source share