avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject svn commit: rev 36079 - avalon/trunk/planet/facilities/console/impl/src/main/org/apache/avalon/facilities/console/impl
Date Sun, 08 Aug 2004 07:51:56 GMT
Author: niclas
Date: Sun Aug  8 00:51:55 2004
New Revision: 36079

Modified:
   avalon/trunk/planet/facilities/console/impl/src/main/org/apache/avalon/facilities/console/impl/ConsoleImpl.java
Log:
Steve indirectly reminded me that the socket needs to be closed after refused.

Modified: avalon/trunk/planet/facilities/console/impl/src/main/org/apache/avalon/facilities/console/impl/ConsoleImpl.java
==============================================================================
--- avalon/trunk/planet/facilities/console/impl/src/main/org/apache/avalon/facilities/console/impl/ConsoleImpl.java
(original)
+++ avalon/trunk/planet/facilities/console/impl/src/main/org/apache/avalon/facilities/console/impl/ConsoleImpl.java
Sun Aug  8 00:51:55 2004
@@ -309,9 +309,10 @@
         boolean running = true;
         while( running )
         {
+            Socket socket = null;
             try
             {
-                Socket socket = m_ServerSocket.accept();
+                socket = m_ServerSocket.accept();
                 validateHost( socket.getInetAddress() );
                 CommandInterpreterImpl intp = new CommandInterpreterImpl( socket, m_Welcome,
m_Commands, m_RootModel );
                 synchronized( m_Interpreters )
@@ -325,6 +326,8 @@
             } catch( DeniedHostException e )
             {
                 getLogger().warn( e.getMessage() );
+                socket.close();
+                
             } catch( Exception e )
             {
                 getLogger().warn( "", e );

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message