diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2014-09-17 13:50:35 -0230 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2014-09-17 13:50:35 -0230 |
commit | a3d676c4199ff53edd458abf7ce52f6cf83213b4 (patch) | |
tree | d6975ba5b7c3d9e58b5378f2e27ec536e4157517 /cpp/src/Ice/TcpEndpointI.cpp | |
parent | Simplified creation of Admin facets in IceBox; simplified test for Admin enab... (diff) | |
download | ice-a3d676c4199ff53edd458abf7ce52f6cf83213b4.tar.bz2 ice-a3d676c4199ff53edd458abf7ce52f6cf83213b4.tar.xz ice-a3d676c4199ff53edd458abf7ce52f6cf83213b4.zip |
ICE-4891 some minor improvements
Diffstat (limited to 'cpp/src/Ice/TcpEndpointI.cpp')
-rw-r--r-- | cpp/src/Ice/TcpEndpointI.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/cpp/src/Ice/TcpEndpointI.cpp b/cpp/src/Ice/TcpEndpointI.cpp index 49b44649038..68f24ebb917 100644 --- a/cpp/src/Ice/TcpEndpointI.cpp +++ b/cpp/src/Ice/TcpEndpointI.cpp @@ -21,6 +21,8 @@ using namespace std; using namespace Ice; using namespace IceInternal; +IceUtil::Shared* IceInternal::upCast(TcpEndpointI* p) { return p; } + IceInternal::TcpEndpointI::TcpEndpointI(const ProtocolInstancePtr& instance, const string& host, Int port, const Address& sourceAddr, Int timeout, const string& connectionId, bool compress) : @@ -144,20 +146,14 @@ IceInternal::TcpEndpointI::transceiver() const AcceptorPtr IceInternal::TcpEndpointI::acceptor(const string&) const { - return new TcpAcceptor(_instance, _host, _port); -} - -EndpointIPtr -IceInternal::TcpEndpointI::endpoint(const TransceiverPtr& transceiver) const -{ - return const_cast<TcpEndpointI*>(this); + return new TcpAcceptor(const_cast<TcpEndpointI*>(this), _instance, _host, _port); } -EndpointIPtr -IceInternal::TcpEndpointI::endpoint(const AcceptorPtr& acceptor) const +TcpEndpointIPtr +IceInternal::TcpEndpointI::endpoint(const TcpAcceptorPtr& acceptor) const { - TcpAcceptor* p = dynamic_cast<TcpAcceptor*>(acceptor.get()); - return createEndpoint(_host, p->effectivePort(), _connectionId); + return new TcpEndpointI(_instance, _host, acceptor->effectivePort(), _sourceAddr, _timeout, _connectionId, + _compress); } string |