I'm running into a problem with the APR connector not shutting down
properly on Unix and Linux systems (seems to work fine on Windows).
Tomcat runs fine with the APR connector and there are no errors on
shutdown.  However, when I try to restart Tomcat I get a socket bind
failed error in the catalina log.  I have to wait several minutes
between shutdown and startup for Tomcat to be able to startup correctly.
Apparently it takes a few minutes for the OS to recycle the zombie
socket.  I've tried adding the following lines to network.c (~ line
388), but it didn't fix the problem.

apr_status_t rv = apr_socket_opt_set( s, APR_SO_REUSEADDR, 1 );
if ( rv != APR_SUCCESS )
{
  char errorbuf[ 256];
  apr_strerror( rv, errorbuf, sizeof(errorbuf) );
  fprintf(stderr, "result is %d, %s\n", rv, errorbuf );
 ...

I get this is what is output:  "result is 9, Bad file number".

Does anyone who worked on the APR connector have any suggestions on how
to solve this problem?  It doesn't seem right that you have to wait
several minutes between stopping and restarting Tomcat.  Thanks in
advance.
,
Josh.

Reply via email to