Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Commit

Permalink
Sync the future on wait (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
TeksuSiK authored and Camotoy committed Jan 9, 2022
1 parent cc069e6 commit d908ccc
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 d908ccc

Please sign in to comment.