[jboss-cvs] JBoss Messaging SVN: r4850 - trunk/src/main/org/jboss/messaging/core/remoting/impl/netty.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Aug 20 04:15:31 EDT 2008


Author: trustin
Date: 2008-08-20 04:15:31 -0400 (Wed, 20 Aug 2008)
New Revision: 4850

Modified:
   trunk/src/main/org/jboss/messaging/core/remoting/impl/netty/NettyConnector.java
Log:
Fixed timeouts related with SSL Netty connections

Modified: trunk/src/main/org/jboss/messaging/core/remoting/impl/netty/NettyConnector.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/remoting/impl/netty/NettyConnector.java	2008-08-20 07:55:46 UTC (rev 4849)
+++ trunk/src/main/org/jboss/messaging/core/remoting/impl/netty/NettyConnector.java	2008-08-20 08:15:31 UTC (rev 4850)
@@ -42,7 +42,6 @@
 import org.jboss.netty.channel.Channel;
 import org.jboss.netty.channel.ChannelFactory;
 import org.jboss.netty.channel.ChannelFuture;
-import org.jboss.netty.channel.ChannelFutureListener;
 import org.jboss.netty.channel.ChannelPipeline;
 import org.jboss.netty.channel.ChannelPipelineCoverage;
 import org.jboss.netty.channel.ChannelPipelineFactory;
@@ -200,17 +199,14 @@
             log.info("Starting SSL handshake.");
             try
             {
-               sslHandler.handshake(ch).addListener(new ChannelFutureListener()
-               {
-                  public void operationComplete(ChannelFuture future) throws Exception
-                  {
-                     if (future.isSuccess()) {
-                        ch.getPipeline().get(MessagingChannelHandler.class).active = true;
-                     } else {
-                        ch.close();
-                     }
-                  }
-               });
+               ChannelFuture handshakeFuture = sslHandler.handshake(ch);
+               handshakeFuture.awaitUninterruptibly();
+               if (handshakeFuture.isSuccess()) {
+                  ch.getPipeline().get(MessagingChannelHandler.class).active = true;
+               } else {
+                  ch.close().awaitUninterruptibly();
+                  return null;
+               }
             }
             catch (SSLException e)
             {
@@ -221,7 +217,7 @@
             ch.getPipeline().get(MessagingChannelHandler.class).active = true;
          }
 
-         return new NettyConnection(future.getChannel());
+         return new NettyConnection(ch);
       }
       else
       {




More information about the jboss-cvs-commits mailing list