diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2014-08-07 12:18:42 -0230 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2014-08-07 12:18:42 -0230 |
commit | 232fa424a7339659b6ad2cd02fbfe89420457601 (patch) | |
tree | 978d9e9286c2915b771f8bea019276ab216eecc4 /cpp/src/Ice/TcpConnector.cpp | |
parent | Windows SSL SChannel implementation & OS X Secure Transport fixes. (diff) | |
download | ice-232fa424a7339659b6ad2cd02fbfe89420457601.tar.bz2 ice-232fa424a7339659b6ad2cd02fbfe89420457601.tar.xz ice-232fa424a7339659b6ad2cd02fbfe89420457601.zip |
ICE-5457 added ability to set source address for connections
Diffstat (limited to 'cpp/src/Ice/TcpConnector.cpp')
-rw-r--r-- | cpp/src/Ice/TcpConnector.cpp | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/cpp/src/Ice/TcpConnector.cpp b/cpp/src/Ice/TcpConnector.cpp index 934315bc129..41579d374df 100644 --- a/cpp/src/Ice/TcpConnector.cpp +++ b/cpp/src/Ice/TcpConnector.cpp @@ -30,7 +30,8 @@ IceInternal::TcpConnector::connect() try { - TransceiverPtr transceiver = new TcpTransceiver(_instance, createSocket(false, _addr), _proxy, _addr); + TransceiverPtr transceiver = + new TcpTransceiver(_instance, createSocket(false, _addr), _proxy, _addr, _sourceAddr); dynamic_cast<TcpTransceiver*>(transceiver.get())->connect(); return transceiver; } @@ -70,12 +71,17 @@ IceInternal::TcpConnector::operator==(const Connector& r) const { return false; } - + if(_timeout != p->_timeout) { return false; } + if(compareAddress(_sourceAddr, p->_sourceAddr) != 0) + { + return false; + } + if(_connectionId != p->_connectionId) { return false; @@ -108,6 +114,16 @@ IceInternal::TcpConnector::operator<(const Connector& r) const return false; } + int rc = compareAddress(_sourceAddr, p->_sourceAddr); + if(rc < 0) + { + return true; + } + else if(rc > 0) + { + return false; + } + if(_connectionId < p->_connectionId) { return true; @@ -119,11 +135,13 @@ IceInternal::TcpConnector::operator<(const Connector& r) const return compareAddress(_addr, p->_addr) < 0; } -IceInternal::TcpConnector::TcpConnector(const ProtocolInstancePtr& instance, const Address& addr, - const NetworkProxyPtr& proxy, Ice::Int timeout, const string& connectionId) : +IceInternal::TcpConnector::TcpConnector(const ProtocolInstancePtr& instance, const Address& addr, + const NetworkProxyPtr& proxy, const Address& sourceAddr, + Ice::Int timeout, const string& connectionId) : _instance(instance), _addr(addr), _proxy(proxy), + _sourceAddr(sourceAddr), _timeout(timeout), _connectionId(connectionId) { |