mirror of
https://github.com/GeyserMC/MCProtocolLib.git
synced 2024-12-13 09:11:03 -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() {
|
future.addListener(new ChannelFutureListener() {
|
||||||
@Override
|
@Override
|
||||||
public void operationComplete(ChannelFuture future) throws Exception {
|
public void operationComplete(ChannelFuture future) throws Exception {
|
||||||
|
System.err.println("Future start.");
|
||||||
if(!future.isSuccess()) {
|
if(!future.isSuccess()) {
|
||||||
exceptionCaught(null, future.cause());
|
exceptionCaught(null, future.cause());
|
||||||
}
|
}
|
||||||
|
System.err.println("Future end.");
|
||||||
}
|
}
|
||||||
}).await();
|
}).await();
|
||||||
} catch(Throwable t) {
|
} catch(Throwable t) {
|
||||||
|
@ -106,6 +108,7 @@ public class TcpClientSession extends TcpSession {
|
||||||
|
|
||||||
if(wait) {
|
if(wait) {
|
||||||
connectTask.run();
|
connectTask.run();
|
||||||
|
System.err.println("Connect completed.");
|
||||||
} else {
|
} else {
|
||||||
new Thread(connectTask).start();
|
new Thread(connectTask).start();
|
||||||
}
|
}
|
||||||
|
|
|
@ -308,13 +308,18 @@ public abstract class TcpSession extends SimpleChannelInboundHandler<Packet> imp
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void channelActive(ChannelHandlerContext ctx) throws Exception {
|
public void channelActive(ChannelHandlerContext ctx) throws Exception {
|
||||||
|
System.err.println("Channel active?");
|
||||||
if(this.disconnected || this.channel != null) {
|
if(this.disconnected || this.channel != null) {
|
||||||
ctx.channel().close();
|
ctx.channel().close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
System.err.println("Channel active.");
|
||||||
|
|
||||||
this.channel = ctx.channel();
|
this.channel = ctx.channel();
|
||||||
|
|
||||||
|
System.err.println("Channel set.");
|
||||||
|
|
||||||
this.packetHandleThread = new Thread(new Runnable() {
|
this.packetHandleThread = new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
Loading…
Reference in a new issue