Merge "report diagstatus from UdpHandler/TcpHandler on Netty thread terminate"
[openflowplugin.git] / openflowjava / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / core / TcpChannelInitializer.java
index e7abda93fb11da7aeba82d029c1cffb7e2256d74..f6e789065cd9fa9bef652764739887728d8b27a6 100644 (file)
@@ -14,6 +14,7 @@ import io.netty.channel.socket.SocketChannel;
 import io.netty.handler.ssl.SslHandler;
 import io.netty.util.concurrent.Future;
 import java.net.InetAddress;
+import java.util.Arrays;
 import java.util.Iterator;
 import java.util.List;
 import java.util.concurrent.TimeUnit;
@@ -69,13 +70,12 @@ public class TcpChannelInitializer extends ProtocolChannelInitializer<SocketChan
         LOG.debug("Incoming connection accepted - building pipeline");
         allChannels.add(ch);
         ConnectionFacade connectionFacade = null;
-        connectionFacade = connectionAdapterFactory.createConnectionFacade(ch, null, useBarrier());
+        connectionFacade = connectionAdapterFactory.createConnectionFacade(ch, null, useBarrier(),
+                getChannelOutboundQueueSize());
         try {
             LOG.debug("Calling OF plugin: {}", getSwitchConnectionHandler());
             getSwitchConnectionHandler().onSwitchConnected(connectionFacade);
             connectionFacade.checkListeners();
-            ch.pipeline().addLast(PipelineHandlers.IDLE_HANDLER.name(),
-                    new IdleHandler(getSwitchIdleTimeout(), TimeUnit.MILLISECONDS));
             boolean tlsPresent = false;
 
             // If this channel is configured to support SSL it will only support SSL
@@ -90,7 +90,8 @@ public class TcpChannelInitializer extends ProtocolChannelInitializer<SocketChan
                     LOG.debug("Requested Cipher Suites are: {}", suitesList);
                     String[] suites = suitesList.toArray(new String[suitesList.size()]);
                     engine.setEnabledCipherSuites(suites);
-                    LOG.debug("Cipher suites enabled in SSLEngine are: {}", engine.getEnabledCipherSuites().toString());
+                    LOG.debug("Cipher suites enabled in SSLEngine are: {}",
+                            Arrays.toString(engine.getEnabledCipherSuites()));
                 }
                 final SslHandler ssl = new SslHandler(engine);
                 final Future<Channel> handshakeFuture = ssl.handshakeFuture();
@@ -109,6 +110,8 @@ public class TcpChannelInitializer extends ProtocolChannelInitializer<SocketChan
             ch.pipeline().addLast(PipelineHandlers.OF_ENCODER.name(), ofEncoder);
             ch.pipeline().addLast(PipelineHandlers.DELEGATING_INBOUND_HANDLER.name(),
                     new DelegatingInboundHandler(connectionFacade));
+            ch.pipeline().addLast(PipelineHandlers.IDLE_HANDLER.name(),
+                    new IdleHandler(getSwitchIdleTimeout(), TimeUnit.MILLISECONDS));
             if (!tlsPresent) {
                 connectionFacade.fireConnectionReadyNotification();
             }