remm        2003/10/03 03:48:45

  Modified:    util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
  Log:
  - Change the way to kill the thread after a server socket restart.
  
  Revision  Changes    Path
  1.20      +10 -8     
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- PoolTcpEndpoint.java      23 Sep 2003 06:37:07 -0000      1.19
  +++ PoolTcpEndpoint.java      3 Oct 2003 10:48:45 -0000       1.20
  @@ -285,7 +285,7 @@
                       throw new BindException(be.getMessage() + ":" + port);
                   }
            }
  -         if( serverTimeout >= 0 )
  +            if( serverTimeout >= 0 )
                serverSocket.setSoTimeout( serverTimeout );
        } catch( IOException ex ) {
            //      log("couldn't start endpoint", ex, Logger.DEBUG);
  @@ -435,8 +435,7 @@
                               log.error(msg, t);
                           } finally {
                               // Current thread is now invalid: kill it
  -                            throw new IllegalStateException
  -                                ("Terminating thread");
  +                            throw new ThreadDeath();
                           }
                       }
                   }
  @@ -537,10 +536,13 @@
        while(endpoint.isRunning()) {
            Socket s = null;
            try {
  -             s = endpoint.acceptSocket();
  +                s = endpoint.acceptSocket();
  +         } catch (ThreadDeath t) {
  +             endpoint.log.error("Shutdown thread: " 
  +                                   + Thread.currentThread().getName());
  +                throw t;
            } catch (Throwable t) {
                endpoint.log.error("Exception in acceptSocket", t);
  -                throw new IllegalStateException("Terminating thread");
            }
            if(null != s) {
                // Continue accepting on another thread...
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to