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/UdpTransceiver.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/UdpTransceiver.java')
-rw-r--r-- | java/src/IceInternal/UdpTransceiver.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/java/src/IceInternal/UdpTransceiver.java b/java/src/IceInternal/UdpTransceiver.java index 70533314e95..10f4c531935 100644 --- a/java/src/IceInternal/UdpTransceiver.java +++ b/java/src/IceInternal/UdpTransceiver.java @@ -229,6 +229,38 @@ final class UdpTransceiver implements Transceiver } } + public Ice.ConnectionInfo + getInfo() + { + assert(_fd != null); + + Ice.UdpConnectionInfo info = new Ice.UdpConnectionInfo(); + java.net.DatagramSocket 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; + } + if(_mcastAddr != null) + { + info.mcastAddress = _mcastAddr.getAddress().getHostAddress(); + info.mcastPort = _mcastAddr.getPort(); + } + else + { + info.mcastAddress = ""; + info.mcastPort = -1; + } + return info; + } + public void checkSendSize(Buffer buf, int messageSizeMax) { |