diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2007-06-07 17:01:30 +0000 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2007-06-07 17:01:30 +0000 |
commit | a737fcdae3a825d1a3df353a08df3c12285cde43 (patch) | |
tree | ce5c2f7aed6194cb4d94cb07e00b7380bc320e7b /cpp/src/Ice/TcpEndpointI.cpp | |
parent | Added missing IComparable (diff) | |
download | ice-a737fcdae3a825d1a3df353a08df3c12285cde43.tar.bz2 ice-a737fcdae3a825d1a3df353a08df3c12285cde43.tar.xz ice-a737fcdae3a825d1a3df353a08df3c12285cde43.zip |
More changes for bug 1996
Diffstat (limited to 'cpp/src/Ice/TcpEndpointI.cpp')
-rw-r--r-- | cpp/src/Ice/TcpEndpointI.cpp | 78 |
1 files changed, 16 insertions, 62 deletions
diff --git a/cpp/src/Ice/TcpEndpointI.cpp b/cpp/src/Ice/TcpEndpointI.cpp index b7552308727..128ecc7bfff 100644 --- a/cpp/src/Ice/TcpEndpointI.cpp +++ b/cpp/src/Ice/TcpEndpointI.cpp @@ -285,15 +285,8 @@ IceInternal::TcpEndpointI::unknown() const return false; } -vector<TransceiverPtr> -IceInternal::TcpEndpointI::clientTransceivers() const -{ - vector<TransceiverPtr> ret; - return ret; -} - TransceiverPtr -IceInternal::TcpEndpointI::serverTransceiver(EndpointIPtr& endp) const +IceInternal::TcpEndpointI::transceiver(EndpointIPtr& endp) const { endp = const_cast<TcpEndpointI*>(this); return 0; @@ -306,7 +299,7 @@ IceInternal::TcpEndpointI::connectors() const vector<struct sockaddr_in> addresses = getAddresses(_host, _port); for(unsigned int i = 0; i < addresses.size(); ++i) { - connectors.push_back(new TcpConnector(_instance, addresses[i])); + connectors.push_back(new TcpConnector(_instance, addresses[i], _timeout, _connectionId)); } return connectors; } @@ -374,6 +367,11 @@ IceInternal::TcpEndpointI::operator==(const EndpointI& r) const return true; } + if(_host != p->_host) + { + return false; + } + if(_port != p->_port) { return false; @@ -394,26 +392,6 @@ IceInternal::TcpEndpointI::operator==(const EndpointI& r) const return false; } - if(_host != p->_host) - { - // - // We do the most time-consuming part of the comparison last. - // - struct sockaddr_in laddr; - struct sockaddr_in raddr; - try - { - getAddress(_host, _port, laddr); - getAddress(p->_host, p->_port, raddr); - } - catch(const DNSException&) - { - return false; - } - - return compareAddress(laddr, raddr); - } - return true; } @@ -437,6 +415,15 @@ IceInternal::TcpEndpointI::operator<(const EndpointI& r) const return false; } + if(_host < p->_host) + { + return true; + } + else if (p->_host < _host) + { + return false; + } + if(_port < p->_port) { return true; @@ -473,39 +460,6 @@ IceInternal::TcpEndpointI::operator<(const EndpointI& r) const return false; } - if(_host != p->_host) - { - // - // We do the most time-consuming part of the comparison last. - // - struct sockaddr_in laddr; - try - { - getAddress(_host, _port, laddr); - } - catch(const DNSException&) - { - } - - struct sockaddr_in raddr; - try - { - getAddress(p->_host, p->_port, raddr); - } - catch(const DNSException&) - { - } - - if(laddr.sin_addr.s_addr < raddr.sin_addr.s_addr) - { - return true; - } - else if(raddr.sin_addr.s_addr < laddr.sin_addr.s_addr) - { - return false; - } - } - return false; } |