Hi,
I want to write a simple chat servlet, like this
(doGet-Method):
response.setContentType("text/html");
out.println("<html><head><title>Chat</title></head><body>");
out.flush();
for (int i = 0; true; i++)
{
out.println("Hallo Bernhard " + i + "<br>");
System.out.println("Sending text " + i);
out.flush();
try { Thread.sleep(2000); } catch (InterruptedException e) {}
}
The problem is, that I don't get any exception if the
client is not connected any more, so the loop does
not stop.
My question: Is there any way how I can determine if
the client has disconnected from the server (like
Response.IsClientConnected in ASP).
TIA
Bernhard
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html