diff options
author | Benoit Foucher <benoit@zeroc.com> | 2008-01-07 10:30:13 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2008-01-07 10:30:13 +0100 |
commit | d9ce265d9766f0d48c6a6c10491be1f782424a2c (patch) | |
tree | 62df7123b09ccbcc617c6024c4b30e1bec45f16b /cpp/src/Ice/TcpConnector.cpp | |
parent | Fixed IceBox/configuration test failure when run with --protocol=ssl (diff) | |
download | ice-d9ce265d9766f0d48c6a6c10491be1f782424a2c.tar.bz2 ice-d9ce265d9766f0d48c6a6c10491be1f782424a2c.tar.xz ice-d9ce265d9766f0d48c6a6c10491be1f782424a2c.zip |
Fixed bug 2304
Diffstat (limited to 'cpp/src/Ice/TcpConnector.cpp')
-rw-r--r-- | cpp/src/Ice/TcpConnector.cpp | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/cpp/src/Ice/TcpConnector.cpp b/cpp/src/Ice/TcpConnector.cpp index eadb705f8e8..956907ad2c6 100644 --- a/cpp/src/Ice/TcpConnector.cpp +++ b/cpp/src/Ice/TcpConnector.cpp @@ -29,19 +29,31 @@ IceInternal::TcpConnector::connect(int timeout) out << "trying to establish tcp connection to " << toString(); } - SOCKET fd = createSocket(false, _addr.ss_family); - setBlock(fd, false); - setTcpBufSize(fd, _instance->initializationData().properties, _logger); - bool connected = doConnect(fd, _addr, timeout); - if(connected) + try { - if(_traceLevels->network >= 1) + SOCKET fd = createSocket(false, _addr.ss_family); + setBlock(fd, false); + setTcpBufSize(fd, _instance->initializationData().properties, _logger); + bool connected = doConnect(fd, _addr, timeout); + if(connected) + { + if(_traceLevels->network >= 1) + { + Trace out(_logger, _traceLevels->networkCat); + out << "tcp connection established\n" << fdToString(fd); + } + } + return new TcpTransceiver(_instance, fd, connected); + } + catch(const Ice::LocalException& ex) + { + if(_traceLevels->network >= 2) { Trace out(_logger, _traceLevels->networkCat); - out << "tcp connection established\n" << fdToString(fd); + out << "failed to establish tcp connection to " << toString() << "\n" << ex; } + throw; } - return new TcpTransceiver(_instance, fd, connected); } Short |