directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r448094 - /directory/trunks/mina/example/src/main/java/org/apache/mina/example/sumup/Client.java
Date Wed, 20 Sep 2006 06:35:31 GMT
Author: trustin
Date: Tue Sep 19 23:35:31 2006
New Revision: 448094

URL: http://svn.apache.org/viewvc?view=rev&rev=448094
Log:
Added a code that sets the worker timeout of the socket connector

Modified:
    directory/trunks/mina/example/src/main/java/org/apache/mina/example/sumup/Client.java

Modified: directory/trunks/mina/example/src/main/java/org/apache/mina/example/sumup/Client.java
URL: http://svn.apache.org/viewvc/directory/trunks/mina/example/src/main/java/org/apache/mina/example/sumup/Client.java?view=diff&rev=448094&r1=448093&r2=448094
==============================================================================
--- directory/trunks/mina/example/src/main/java/org/apache/mina/example/sumup/Client.java
(original)
+++ directory/trunks/mina/example/src/main/java/org/apache/mina/example/sumup/Client.java
Tue Sep 19 23:35:31 2006
@@ -22,7 +22,6 @@
 import java.net.InetSocketAddress;
 
 import org.apache.mina.common.ConnectFuture;
-import org.apache.mina.common.IoConnector;
 import org.apache.mina.common.IoSession;
 import org.apache.mina.common.RuntimeIOException;
 import org.apache.mina.example.sumup.codec.SumUpProtocolCodecFactory;
@@ -61,7 +60,11 @@
             values[ i ] = Integer.parseInt( args[ i ] );
         }
 
-        IoConnector connector = new SocketConnector();
+        SocketConnector connector = new SocketConnector();
+
+        // Change the worker timeout to 1 second to make the I/O thread quit soon
+        // when there's no connection to manage.
+        connector.setWorkerTimeout( 1 );
         
         // Configure the service.
         SocketConnectorConfig cfg = new SocketConnectorConfig();



Mime
View raw message