> Hi,
>
> We don't (can't - java doesn't propogate the info out of the native
> methods) know which is the case here. So, it seems we need to
> close/reopen the server socket either way - unfortunate, since pending
> connections could get dropped, but not too terrible, since accept errors
> are fairly rare.
>
> I think the correct thing to do is (in this code from
> HttpConnector.java)
> try {
> socket = serverSocket.accept();
> if (connectionTimeout > 0)
> socket.setSoTimeout(connectionTimeout);
> } catch (IOException e) {
> if (started && !stopped)
> log("accept: ", e);
> break;
> }
>
> Change the 'break' to something like:
> serverSocket.close();
> serverSocket = open();
> continue;
>
> I'm not familiar with the tomcat code, though, so I'm not certain this
> is correct. Also, this is very difficult to reproduce (it's only
> happened once, more or less randomly). Comments? Ideas? People with more
> knowledge of low-level socket code?
Thanks a lot for finding that problem :-)
Closing and reopening the socket is probably the only clean solution. Unless
someone has a better idea, I'll commit the fix tomorrow.
Remy