diff options
Diffstat (limited to 'java/src/IceInternal/TcpEndpointI.java')
-rw-r--r-- | java/src/IceInternal/TcpEndpointI.java | 76 |
1 files changed, 12 insertions, 64 deletions
diff --git a/java/src/IceInternal/TcpEndpointI.java b/java/src/IceInternal/TcpEndpointI.java index 3929ab77681..ecdbd544d28 100644 --- a/java/src/IceInternal/TcpEndpointI.java +++ b/java/src/IceInternal/TcpEndpointI.java @@ -318,16 +318,6 @@ final class TcpEndpointI extends EndpointI } // - // Return client side transceivers for this endpoint, or empty list - // if a transceiver can only be created by a connector. - // - public java.util.ArrayList - clientTransceivers() - { - return new java.util.ArrayList(); - } - - // // Return a server side transceiver for this endpoint, or null if a // transceiver can only be created by an acceptor. In case a // transceiver is created, this operation also returns a new @@ -335,7 +325,7 @@ final class TcpEndpointI extends EndpointI // for example, if a dynamic port number is assigned. // public Transceiver - serverTransceiver(EndpointIHolder endpoint) + transceiver(EndpointIHolder endpoint) { endpoint.value = this; return null; @@ -353,7 +343,7 @@ final class TcpEndpointI extends EndpointI java.util.Iterator p = addresses.iterator(); while(p.hasNext()) { - connectors.add(new TcpConnector(_instance, (java.net.InetSocketAddress)p.next())); + connectors.add(new TcpConnector(_instance, (java.net.InetSocketAddress)p.next(), _timeout, _connectionId)); } return connectors; } @@ -454,7 +444,15 @@ final class TcpEndpointI extends EndpointI } catch(ClassCastException ex) { - return 1; + try + { + EndpointI e = (EndpointI)obj; + return type() < e.type() ? -1 : 1; + } + catch(ClassCastException ee) + { + assert(false); + } } if(this == p) @@ -494,57 +492,7 @@ final class TcpEndpointI extends EndpointI return 1; } - if(!_host.equals(p._host)) - { - // - // We do the most time-consuming part of the comparison last. - // - java.net.InetSocketAddress laddr = null; - try - { - laddr = Network.getAddress(_host, _port); - } - catch(Ice.DNSException ex) - { - } - - java.net.InetSocketAddress raddr = null; - try - { - raddr = Network.getAddress(p._host, p._port); - } - catch(Ice.DNSException ex) - { - } - - if(laddr == null && raddr != null) - { - return -1; - } - else if(raddr == null && laddr != null) - { - return 1; - } - else if(laddr != null && raddr != null) - { - byte[] larr = laddr.getAddress().getAddress(); - byte[] rarr = raddr.getAddress().getAddress(); - assert(larr.length == rarr.length); - for(int i = 0; i < larr.length; i++) - { - if(larr[i] < rarr[i]) - { - return -1; - } - else if(rarr[i] < larr[i]) - { - return 1; - } - } - } - } - - return 0; + return _host.compareTo(p._host); } public boolean |