Client Connection is not timeout after specified time

prakash32 gnanu.prakash at gmail.com
Thu Aug 4 16:50:51 EDT 2011


Hi,

   Am transferring  beans in between client and server. i am able to sending
and getting beans, but when server is connected not giving response for long
time like 10 min , am not getting any connection timeout error .
  I am setting client connection as
  bootstrap.setOption("connectTimeoutMillis", 10000), after 10 sec
connection is waiting for response.

And i try with ReadTimeoutHandler but still am getting problem .please
suggest me.

 below is my client code 



	ClientBootstrap bootstrap = new ClientBootstrap(
                new NioClientSocketChannelFactory(
                        Executors.newCachedThreadPool(),
                        Executors.newCachedThreadPool()));
		

        bootstrap.setPipelineFactory(new MyPipelineFactory(requestObject));
        
      bootstrap.setOption("connectTimeoutMillis", 100);
        
        bootstrap.setOption("tcpNoDelay", true);
        bootstrap.setOption("keepAlive", true);
        bootstrap.setOption("reuserAddress", true);
        ChannelFuture connectFuture = bootstrap.connect(new
InetSocketAddress(host, port));
        connectFuture.awaitUninterruptibly(10,TimeUnit.SECONDS);
        Channel channel =  connectFuture.getChannel();
        
        if (!connectFuture.isSuccess()) {
        	connectFuture.getCause().printStackTrace();
            bootstrap.releaseExternalResources();
            throw new RuntimeException(connectFuture.getCause());
          }
      

       RequestHandler handler = 
(RequestHandler) channel.getPipeline().getLast();
      
       
        	
        connectFuture.getChannel().getCloseFuture().awaitUninterruptibly();
       
        bootstrap.releaseExternalResources();
 

--
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Client-Connection-is-not-timeout-after-specified-time-tp6654232p6654232.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list