diff options
author | Marc Laukien <marc@zeroc.com> | 2003-11-06 05:10:05 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2003-11-06 05:10:05 +0000 |
commit | 7816254e21f180386d95f2408d424d7ca59f0767 (patch) | |
tree | 84f6b6f16e434c74054d9cfaf89c8513d607dc27 /cpp/src/Ice/TcpEndpoint.cpp | |
parent | Changed FD_SETSIZE to 1024 under Windows. (diff) | |
download | ice-7816254e21f180386d95f2408d424d7ca59f0767.tar.bz2 ice-7816254e21f180386d95f2408d424d7ca59f0767.tar.xz ice-7816254e21f180386d95f2408d424d7ca59f0767.zip |
DNSException fix
Diffstat (limited to 'cpp/src/Ice/TcpEndpoint.cpp')
-rw-r--r-- | cpp/src/Ice/TcpEndpoint.cpp | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/cpp/src/Ice/TcpEndpoint.cpp b/cpp/src/Ice/TcpEndpoint.cpp index 6e76d8b5293..6712ae08213 100644 --- a/cpp/src/Ice/TcpEndpoint.cpp +++ b/cpp/src/Ice/TcpEndpoint.cpp @@ -330,9 +330,17 @@ IceInternal::TcpEndpoint::operator==(const Endpoint& r) const // struct sockaddr_in laddr; struct sockaddr_in raddr; - getAddress(_host, _port, laddr); - getAddress(p->_host, p->_port, raddr); - return compareAddress(laddr, raddr); + try + { + getAddress(_host, _port, laddr); + getAddress(p->_host, p->_port, raddr); + } + catch(const DNSException&) + { + return false; + } + + return compareAddress(laddr, raddr); } return true; @@ -391,9 +399,23 @@ IceInternal::TcpEndpoint::operator<(const Endpoint& r) const // 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; - getAddress(_host, _port, laddr); - getAddress(p->_host, p->_port, raddr); + try + { + getAddress(p->_host, p->_port, raddr); + } + catch(const DNSException&) + { + } + if(laddr.sin_addr.s_addr < raddr.sin_addr.s_addr) { return true; |