diff options
author | Benoit Foucher <benoit@zeroc.com> | 2009-10-12 10:45:43 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2009-10-12 10:45:43 +0200 |
commit | f7ec04896f054614a1f08a66c4f7cf9fe71d8f6a (patch) | |
tree | 6d56b2613e3b5f15e7529dcc8afef495b9e566c7 /java/src/IceInternal/TcpTransceiver.java | |
parent | Bug 4222 - cannot install to network drive (diff) | |
download | ice-f7ec04896f054614a1f08a66c4f7cf9fe71d8f6a.tar.bz2 ice-f7ec04896f054614a1f08a66c4f7cf9fe71d8f6a.tar.xz ice-f7ec04896f054614a1f08a66c4f7cf9fe71d8f6a.zip |
Added ConnectionInfo/EndpointInfo, bug 4280 & 3964
Diffstat (limited to 'java/src/IceInternal/TcpTransceiver.java')
-rw-r--r-- | java/src/IceInternal/TcpTransceiver.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/java/src/IceInternal/TcpTransceiver.java b/java/src/IceInternal/TcpTransceiver.java index 6d4a2901f5e..fef0558e62c 100644 --- a/java/src/IceInternal/TcpTransceiver.java +++ b/java/src/IceInternal/TcpTransceiver.java @@ -221,6 +221,27 @@ final class TcpTransceiver implements Transceiver return _desc; } + public Ice.ConnectionInfo + getInfo() + { + assert(_fd != null); + Ice.TcpConnectionInfo info = new Ice.TcpConnectionInfo(); + java.net.Socket socket = _fd.socket(); + info.localAddress = socket.getLocalAddress().getHostAddress(); + info.localPort = socket.getLocalPort(); + if(socket.getInetAddress() != null) + { + info.remoteAddress = socket.getInetAddress().getHostAddress(); + info.remotePort = socket.getPort(); + } + else + { + info.remoteAddress = ""; + info.remotePort = -1; + } + return info; + } + public void checkSendSize(Buffer buf, int messageSizeMax) { |