mirror of
https://github.com/GeyserMC/MCProtocolLib.git
synced 2024-12-12 08:41:00 -05:00
Test.
This commit is contained in:
parent
83a5cb405c
commit
310de7c490
2 changed files with 8 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -308,13 +308,18 @@ public abstract class TcpSession extends SimpleChannelInboundHandler<Packet> 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() {
|
||||
|
|
Loading…
Reference in a new issue