Hi,
I the following Comet question; due to a server event (not a comet
event), I want to write some data to a client request and finish the
request. Currently I write the data and then call OutputStream.close()
on the response output stream. This seems to work, except that it takes
a long time before I get an END event for that request. On the client
this causes the EOF to the request input stream to arrive very late.
This is a problem, because both the server and client are handling so
many requests that I run out of file descriptors and get the following
exception (on the server):
Apr 26, 2007 10:28:23 AM org.apache.tomcat.util.net.NioEndpoint$Acceptor run
SEVERE: Socket accept failed
java.io.IOException: Too many open files
at sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method)
at
sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:145)
at
org.apache.tomcat.util.net.NioEndpoint$Acceptor.run(NioEndpoint.java:1177)
at java.lang.Thread.run(Thread.java:619)
Note: I'm running the client and server on the same machine, but the
client does not get any "Too many open files" exceptions (it does not
get any exceptions at all), so I'm assuming the process limit of tomcat
is reached, suggesting that tomcat is not closing the request sockets
until the END event...
If I close the request on the client side before I get the EOF (-1) in a
read I don't get the Too many open files problem and generally get the
END event immediately on the server side, but I sporadically get
NullPointerExceptions and AsynchronousCloseExceptions and
ClosedChannelExceptions on the server side in the OutputStream.close()
method. I figure the proper method is for the client tp wait for the
server to say "the request is done" (by waiting for the EOF) before
closing thesocket, but how do I make sure it gets closed immediately on
the server side if I'm not in a comet event?
Regards,
Sebastiaan
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]