summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/TcpConnector.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2007-11-27 11:58:35 +0100
committerBenoit Foucher <benoit@zeroc.com>2007-11-27 11:58:35 +0100
commit47f800495093fd7679a315e2d730fea22f6135b7 (patch)
treea7b8d3488f3841367dd03d10cae293f36fd10481 /cpp/src/Ice/TcpConnector.cpp
parentFixed SystemException to no longer derive from LocalException (diff)
downloadice-47f800495093fd7679a315e2d730fea22f6135b7.tar.bz2
ice-47f800495093fd7679a315e2d730fea22f6135b7.tar.xz
ice-47f800495093fd7679a315e2d730fea22f6135b7.zip
- Added support for non-blocking AMI/batch requests, connection
creation. - Added support for AMI oneway requests. - Changed collocation optimization to not perform any DNS lookups.
Diffstat (limited to 'cpp/src/Ice/TcpConnector.cpp')
-rw-r--r--cpp/src/Ice/TcpConnector.cpp30
1 files changed, 8 insertions, 22 deletions
diff --git a/cpp/src/Ice/TcpConnector.cpp b/cpp/src/Ice/TcpConnector.cpp
index 5979914fedd..a4394598ba9 100644
--- a/cpp/src/Ice/TcpConnector.cpp
+++ b/cpp/src/Ice/TcpConnector.cpp
@@ -32,15 +32,16 @@ IceInternal::TcpConnector::connect(int timeout)
SOCKET fd = createSocket(false);
setBlock(fd, false);
setTcpBufSize(fd, _instance->initializationData().properties, _logger);
- doConnect(fd, _addr, timeout);
-
- if(_traceLevels->network >= 1)
+ bool connected = doConnect(fd, _addr, timeout);
+ if(connected)
{
- Trace out(_logger, _traceLevels->networkCat);
- out << "tcp connection established\n" << fdToString(fd);
+ if(_traceLevels->network >= 1)
+ {
+ Trace out(_logger, _traceLevels->networkCat);
+ out << "tcp connection established\n" << fdToString(fd);
+ }
}
-
- return new TcpTransceiver(_instance, fd);
+ return new TcpTransceiver(_instance, fd, connected);
}
Short
@@ -118,21 +119,6 @@ IceInternal::TcpConnector::operator<(const Connector& r) const
return compareAddress(_addr, p->_addr) == -1;
}
-bool
-IceInternal::TcpConnector::equivalent(const string& host, int port) const
-{
- struct sockaddr_in addr;
- try
- {
- getAddress(host, port, addr);
- }
- catch(const DNSException&)
- {
- return false;
- }
- return compareAddress(addr, _addr) == 0;
-}
-
IceInternal::TcpConnector::TcpConnector(const InstancePtr& instance, const struct sockaddr_in& addr, Ice::Int timeout,
const string& connectionId) :
_instance(instance),