mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
fixed issue #483 , show slave hosts
This commit is contained in:
@@ -138,6 +138,16 @@ public class BioSocketChannel implements SocketChannel {
|
||||
if (socket != null) {
|
||||
return socket.getRemoteSocketAddress();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public SocketAddress getLocalSocketAddress() {
|
||||
Socket socket = this.socket;
|
||||
if (socket != null) {
|
||||
return socket.getLocalSocketAddress();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -216,6 +216,10 @@ public class NettySocketChannel implements SocketChannel {
|
||||
return channel != null ? channel.remoteAddress() : null;
|
||||
}
|
||||
|
||||
public SocketAddress getLocalSocketAddress() {
|
||||
return channel != null ? channel.localAddress() : null;
|
||||
}
|
||||
|
||||
public void close() {
|
||||
if (channel != null) {
|
||||
channel.close();
|
||||
|
||||
@@ -21,5 +21,7 @@ public interface SocketChannel {
|
||||
|
||||
public SocketAddress getRemoteSocketAddress();
|
||||
|
||||
public SocketAddress getLocalSocketAddress();
|
||||
|
||||
public void close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user