Skip to content

Commit

Permalink
修改failover,支持hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
gaohaoxiang committed Jun 8, 2020
1 parent e697ec7 commit 3a4007b
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.util.concurrent.Future;

Expand Down Expand Up @@ -218,6 +219,9 @@ protected boolean isNeedReconnect() {

protected boolean reconnect() {
try {
if (address instanceof InetSocketAddress) {
address = new InetSocketAddress(((InetSocketAddress) address).getHostString(), ((InetSocketAddress) address).getPort());
}
ChannelTransport newTransport = (ChannelTransport) transportClient.createTransport(address, connectionTimeout);
ChannelTransport delegate = this.delegate;
this.delegate = newTransport;
Expand Down

0 comments on commit 3a4007b

Please sign in to comment.