Skip to content

Commit

Permalink
Sync the future on wait (GeyserMC#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
TeksuSiK authored Jan 5, 2022
1 parent 50b53e8 commit a09d0fd
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,14 @@ public void initChannel(Channel channel) {
bootstrap.remoteAddress(remoteAddress);
bootstrap.localAddress(bindAddress, bindPort);

bootstrap.connect().addListener((future) -> {
if (!future.isSuccess()) {
exceptionCaught(null, future.cause());
ChannelFuture future = bootstrap.connect();
if (wait) {
future.sync();
}

future.addListener((futureListener) -> {
if (!futureListener.isSuccess()) {
exceptionCaught(null, futureListener.cause());
}
});
} catch(Throwable t) {
Expand Down

0 comments on commit a09d0fd

Please sign in to comment.