From 310de7c4906e0bef9d8a5a93325ec922f11b3b0c Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Fri, 21 Aug 2015 20:52:17 -0700 Subject: [PATCH] Test. --- .../java/org/spacehq/packetlib/tcp/TcpClientSession.java | 3 +++ src/main/java/org/spacehq/packetlib/tcp/TcpSession.java | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/src/main/java/org/spacehq/packetlib/tcp/TcpClientSession.java b/src/main/java/org/spacehq/packetlib/tcp/TcpClientSession.java index cd73dcd8..d8b0f6a3 100644 --- a/src/main/java/org/spacehq/packetlib/tcp/TcpClientSession.java +++ b/src/main/java/org/spacehq/packetlib/tcp/TcpClientSession.java @@ -93,9 +93,11 @@ public class TcpClientSession extends TcpSession { future.addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { + System.err.println("Future start."); if(!future.isSuccess()) { exceptionCaught(null, future.cause()); } + System.err.println("Future end."); } }).await(); } catch(Throwable t) { @@ -106,6 +108,7 @@ public class TcpClientSession extends TcpSession { if(wait) { connectTask.run(); + System.err.println("Connect completed."); } else { new Thread(connectTask).start(); } diff --git a/src/main/java/org/spacehq/packetlib/tcp/TcpSession.java b/src/main/java/org/spacehq/packetlib/tcp/TcpSession.java index cc74912f..04381734 100644 --- a/src/main/java/org/spacehq/packetlib/tcp/TcpSession.java +++ b/src/main/java/org/spacehq/packetlib/tcp/TcpSession.java @@ -308,13 +308,18 @@ public abstract class TcpSession extends SimpleChannelInboundHandler imp @Override public void channelActive(ChannelHandlerContext ctx) throws Exception { + System.err.println("Channel active?"); if(this.disconnected || this.channel != null) { ctx.channel().close(); return; } + System.err.println("Channel active."); + this.channel = ctx.channel(); + System.err.println("Channel set."); + this.packetHandleThread = new Thread(new Runnable() { @Override public void run() {