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() {