Hi :-)
* I hava a question: how to detect the "HTTP connecting status"
in Servlet-side, I suspect that I can split it into 3 parts:
-1 how to detect it when Servlet is receiving requesting from client
-2 how to detect it when Servlet has already got all requesting,
but doesn't begin to response
-3 how to detect it when Servlet is responsing to client
* for example(2/3), I suppose I have a Servlet class MyServlet:
- every time after receiving a request, MyServlet will work for
a long time,(for example, a long time database searching )
- during this period, the client(for ex., a browser) will wait there or
leave(the user goto another page...)
- the question is: how can MyServlet know that the client is still there
or already leave? for example, I suppose that if MyServlet knows
the client has already leave, MyServlet can stop the database searching
* yesterday there are several emails in TOMCAT-USER Listwhich intrduces
to use ServletResponse.flushBuffer() which is in Servlet APIspec2.2+,
i.e., trying to detect the connection status by catching the IOException of
flushBuffer().
* my questions are:
- does the above sulotion work? does it work for both the following:
% Servlet-container only
% WEB-server(for example, Apache) + Servlet-container
% if the buffer is already empty, can it work? i.e., can " a method in
a class which extends OutputStream" throw(s) a IOException when
In Fact it doesn't output bytes? otherwise, if I don't have data in
the
buffer, I will not be able to detect the connection status.
- is it possible to use "java.io.InputStream.available()" in Servlet-side to
detect the connection status?
- is there other way to detect the connection status?
thanks in advance :-)
Bo
June 21, 2001
___________________________________________________________________________
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