fhanik 2004/04/08 07:58:11 Modified: modules/cluster/src/share/org/apache/catalina/cluster/tcp ReplicationListener.java Log: Make sure to close the channel upon server stop. Revision Changes Path 1.15 +10 -1 jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp/ReplicationListener.java Index: ReplicationListener.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp/ReplicationListener.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- ReplicationListener.java 7 Apr 2004 19:02:31 -0000 1.14 +++ ReplicationListener.java 8 Apr 2004 14:58:11 -0000 1.15 @@ -49,6 +49,7 @@ private long tcpSelectorTimeout; private int tcpListenPort; private boolean isSenderSynchronized; + private Selector selector = null; private Object interestOpsMutex = new Object(); @@ -98,7 +99,7 @@ // Get the associated ServerSocket to bind it with ServerSocket serverSocket = serverChannel.socket(); // create a new Selector for use below - Selector selector = Selector.open(); + selector = Selector.open(); // set the port the server channel will listen to serverSocket.bind (new InetSocketAddress (bind,tcpListenPort)); // set non-blocking mode for the listening socket @@ -166,6 +167,14 @@ public void stopListening(){ doListen = false; + if ( selector != null ) { + try { + selector.close(); + selector = null; + } catch ( Exception x ) { + log.error("Unable to close cluster receiver selector.",x); + } + } } public void setCatalinaCluster(CatalinaCluster cluster) {
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]