You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by mm...@apache.org on 2001/08/22 18:53:57 UTC

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/server Ajp12.java

mmanders    01/08/22 09:53:57

  Modified:    src/share/org/apache/tomcat/modules/server Ajp12.java
  Log:
  On some platforms (NetWare) calling System.exit without closing a socket leaves the socket in a timewait state for several minutes making it impossible to restart Tomcat quickly.  Added code to handle shutdown a little cleaner.
  
  Revision  Changes    Path
  1.19      +7 -0      jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Ajp12.java
  
  Index: Ajp12.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Ajp12.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- Ajp12.java	2001/05/21 04:27:54	1.18
  +++ Ajp12.java	2001/08/22 16:53:57	1.19
  @@ -282,6 +282,13 @@
   				// that stopping everything doesn't work -
   				// need to figure
   				// out what happens with the threads ( XXX )
  +                                // until we remove the System.exit() call we
  +                                // also need to close the socket to allow the
  +                                // underlying layer to shutdown the connection
  +                                // properly.  Setting soLinger small will
  +                                // speed this up.
  +                                socket.setSoLinger(true, 0);
  +                                sin.close();
   				System.exit(0);
   				shutdown=true;
   				return;