Skip to content

Commit

Permalink
Merge 36652c2 into 0fc2fe9
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanwenjun authored May 21, 2024
2 parents 0fc2fe9 + 36652c2 commit e6211a8
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public IRpcResponse sendSync(final Host host,
return iRpcResponse;
}

private Channel getOrCreateChannel(Host host) {
Channel getOrCreateChannel(Host host) {
Channel channel = channels.get(host);
if (channel != null && channel.isActive()) {
return channel;
Expand All @@ -166,13 +166,10 @@ private Channel getOrCreateChannel(Host host) {
* @param host host
* @return channel
*/
private Channel createChannel(Host host) {
Channel createChannel(Host host) {
try {
ChannelFuture future;
synchronized (bootstrap) {
future = bootstrap.connect(new InetSocketAddress(host.getIp(), host.getPort()));
}
future.await(clientConfig.getConnectTimeoutMillis());
ChannelFuture future = bootstrap.connect(new InetSocketAddress(host.getIp(), host.getPort()));
future = future.sync();
if (future.isSuccess()) {
return future.channel();
} else {
Expand Down

0 comments on commit e6211a8

Please sign in to comment.