Skip to content

Commit

Permalink
there is no connection thread, so don't wait for the channel
Browse files Browse the repository at this point in the history
  • Loading branch information
Emanuel Muckenhuber authored and bstansberry committed Oct 23, 2012
1 parent a3072fb commit ae70ee3
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,18 @@ static class Establishing extends FutureManagementChannel {

@Override
public Channel getChannel() throws IOException {
final Channel channel = super.getChannel();
Channel channel = super.getChannel();
if(channel != null) {
return channel;
}
// Try to connect and wait for the channel
connectionManager.connect();
return awaitChannel();
// In case connect did not succeed the next getChannel() call needs to try to reconnect
channel = super.getChannel();
if(channel == null) {
throw ProtocolMessages.MESSAGES.channelClosed();
}
return channel;
}

@Override
Expand Down

0 comments on commit ae70ee3

Please sign in to comment.