From eab9f52f4b5e84df4ab1fed46fe7512f382febd9 Mon Sep 17 00:00:00 2001 From: Bernard Normier Date: Mon, 25 Nov 2024 17:20:10 -0500 Subject: [PATCH] Refactor ConnectionInfo in C++ --- cpp/include/Ice/Connection.h | 148 +++++++++++++++--- cpp/include/Ice/Endpoint.h | 12 +- cpp/include/Ice/SSL/ConnectionInfo.h | 44 +++++- cpp/include/Ice/SSL/EndpointInfo.h | 5 +- cpp/include/Ice/ios/iAPConnectionInfo.h | 37 ++++- cpp/include/IceBT/ConnectionInfo.h | 66 ++++++-- cpp/include/IceBT/EndpointInfo.h | 14 +- cpp/src/Ice/ConnectionI.cpp | 23 +-- cpp/src/Ice/IdleTimeoutTransceiverDecorator.h | 7 +- cpp/src/Ice/SSL/OpenSSLTransceiverI.cpp | 27 ++-- cpp/src/Ice/SSL/OpenSSLTransceiverI.h | 2 +- cpp/src/Ice/SSL/SSLEndpointI.cpp | 3 - cpp/src/Ice/SSL/SchannelTransceiverI.cpp | 18 ++- cpp/src/Ice/SSL/SchannelTransceiverI.h | 2 +- .../Ice/SSL/SecureTransportTransceiverI.cpp | 24 ++- cpp/src/Ice/SSL/SecureTransportTransceiverI.h | 2 +- cpp/src/Ice/TcpEndpointI.cpp | 9 +- cpp/src/Ice/TcpTransceiver.cpp | 28 +++- cpp/src/Ice/TcpTransceiver.h | 2 +- cpp/src/Ice/Transceiver.h | 3 +- cpp/src/Ice/UdpEndpointI.cpp | 8 +- cpp/src/Ice/UdpTransceiver.cpp | 92 +++++++---- cpp/src/Ice/UdpTransceiver.h | 2 +- cpp/src/Ice/WSTransceiver.cpp | 9 +- cpp/src/Ice/WSTransceiver.h | 2 +- cpp/src/Ice/ios/StreamEndpointI.cpp | 9 +- cpp/src/Ice/ios/StreamTransceiver.cpp | 30 +++- cpp/src/Ice/ios/StreamTransceiver.h | 2 +- cpp/src/Ice/ios/iAPTransceiver.h | 2 +- cpp/src/Ice/ios/iAPTransceiver.mm | 21 +-- cpp/src/IceBT/TransceiverI.cpp | 38 +++-- cpp/src/IceBT/TransceiverI.h | 2 +- cpp/test/Ice/background/Transceiver.cpp | 4 +- cpp/test/Ice/background/Transceiver.h | 2 +- 34 files changed, 499 insertions(+), 200 deletions(-) diff --git a/cpp/include/Ice/Connection.h b/cpp/include/Ice/Connection.h index 3f6940386e8..c11a7a2da59 100644 --- a/cpp/include/Ice/Connection.h +++ b/cpp/include/Ice/Connection.h @@ -17,6 +17,14 @@ #include #include +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wshadow-field-in-constructor" +#elif defined(__GNUC__) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wshadow" +#endif + namespace Ice { /** @@ -206,7 +214,6 @@ namespace Ice class ICE_API ConnectionInfo { public: - ConnectionInfo() = default; virtual ~ConnectionInfo(); // Deleted to prevent accidental slicing. @@ -216,19 +223,38 @@ namespace Ice /** * The information of the underlying transport or null if there's no underlying transport. */ - ConnectionInfoPtr underlying; + const ConnectionInfoPtr underlying; + /** * Whether or not the connection is an incoming or outgoing connection. */ - bool incoming; + const bool incoming; + /** * The name of the adapter associated with the connection. */ - std::string adapterName; + const std::string adapterName; + /** * The connection id. */ - std::string connectionId; + const std::string connectionId; + + protected: + explicit ConnectionInfo(ConnectionInfoPtr underlyingInfo) + : underlying{std::move(underlyingInfo)}, + incoming{underlying->incoming}, + adapterName{underlying->adapterName}, + connectionId{underlying->connectionId} + { + } + + ConnectionInfo(bool incoming, std::string adapterName, std::string connectionId) + : incoming{incoming}, + adapterName{std::move(adapterName)}, + connectionId{std::move(connectionId)} + { + } }; /** @@ -238,26 +264,45 @@ namespace Ice class ICE_API IPConnectionInfo : public ConnectionInfo { public: - IPConnectionInfo() = default; IPConnectionInfo(const IPConnectionInfo&) = delete; IPConnectionInfo& operator=(const IPConnectionInfo&) = delete; /** * The local address. */ - std::string localAddress; + const std::string localAddress; + /** * The local port. */ - int localPort = -1; + const int localPort; + /** * The remote address. */ - std::string remoteAddress; + const std::string remoteAddress; + /** * The remote port. */ - int remotePort = -1; + const int remotePort; + + protected: + IPConnectionInfo( + bool incoming, + std::string adapterName, + std::string connectionId, + std::string localAddress, + int localPort, + std::string remoteAddress, + int remotePort) + : ConnectionInfo{incoming, std::move(adapterName), std::move(connectionId)}, + localAddress{std::move(localAddress)}, + localPort{localPort}, + remoteAddress{std::move(remoteAddress)}, + remotePort{remotePort} + { + } }; /** @@ -267,7 +312,6 @@ namespace Ice class ICE_API TCPConnectionInfo final : public IPConnectionInfo { public: - TCPConnectionInfo() = default; ~TCPConnectionInfo() final; TCPConnectionInfo(const TCPConnectionInfo&) = delete; TCPConnectionInfo& operator=(const TCPConnectionInfo&) = delete; @@ -275,11 +319,34 @@ namespace Ice /** * The connection buffer receive size. */ - int rcvSize = 0; + const int rcvSize; /** * The connection buffer send size. */ - int sndSize = 0; + const int sndSize; + + // internal constructor + TCPConnectionInfo( + bool incoming, + std::string adapterName, + std::string connectionId, + std::string localAddress, + int localPort, + std::string remoteAddress, + int remotePort, + int rcvSize, + int sndSize) + : IPConnectionInfo{incoming, std::move(adapterName), std::move(connectionId), std::move(localAddress), localPort, std::move(remoteAddress), remotePort}, + rcvSize{rcvSize}, + sndSize{sndSize} + { + } + + // internal constructor + TCPConnectionInfo(bool incoming, std::string adapterName, std::string connectionId) + : TCPConnectionInfo{incoming, std::move(adapterName), std::move(connectionId), "", -1, "", -1, 0, 0} + { + } }; /** @@ -289,7 +356,6 @@ namespace Ice class ICE_API UDPConnectionInfo final : public IPConnectionInfo { public: - UDPConnectionInfo() = default; ~UDPConnectionInfo() final; UDPConnectionInfo(const UDPConnectionInfo&) = delete; UDPConnectionInfo& operator=(const UDPConnectionInfo&) = delete; @@ -297,19 +363,49 @@ namespace Ice /** * The multicast address. */ - std::string mcastAddress; + const std::string mcastAddress; + /** * The multicast port. */ - int mcastPort = -1; + const int mcastPort; + /** * The connection buffer receive size. */ - int rcvSize = 0; + const int rcvSize; + /** * The connection buffer send size. */ - int sndSize = 0; + const int sndSize; + + // internal constructor + UDPConnectionInfo( + bool incoming, + std::string adapterName, + std::string connectionId, + std::string localAddress, + int localPort, + std::string remoteAddress, + int remotePort, + std::string mcastAddress, + int mcastPort, + int rcvSize, + int sndSize) + : IPConnectionInfo{incoming, std::move(adapterName), std::move(connectionId), std::move(localAddress), localPort, std::move(remoteAddress), remotePort}, + mcastAddress{std::move(mcastAddress)}, + mcastPort{mcastPort}, + rcvSize{rcvSize}, + sndSize{sndSize} + { + } + + // internal constructor + UDPConnectionInfo(bool incoming, std::string adapterName, std::string connectionId) + : UDPConnectionInfo{incoming, std::move(adapterName), std::move(connectionId), "", -1, "", -1, "", -1, 0, 0} + { + } }; /** @@ -319,7 +415,6 @@ namespace Ice class ICE_API WSConnectionInfo final : public ConnectionInfo { public: - WSConnectionInfo() = default; ~WSConnectionInfo() final; WSConnectionInfo(const WSConnectionInfo&) = delete; WSConnectionInfo& operator=(const WSConnectionInfo&) = delete; @@ -327,8 +422,21 @@ namespace Ice /** * The headers from the HTTP upgrade request. */ - HeaderDict headers; + const HeaderDict headers; + + // internal constructor + WSConnectionInfo(ConnectionInfoPtr underlying, HeaderDict headers) + : ConnectionInfo{std::move(underlying)}, + headers{std::move(headers)} + { + } }; } +#if defined(__clang__) +# pragma clang diagnostic pop +#elif defined(__GNUC__) +# pragma GCC diagnostic pop +#endif + #endif diff --git a/cpp/include/Ice/Endpoint.h b/cpp/include/Ice/Endpoint.h index ff9b6d26492..937de25ba62 100644 --- a/cpp/include/Ice/Endpoint.h +++ b/cpp/include/Ice/Endpoint.h @@ -93,8 +93,8 @@ namespace Ice const bool compress; protected: - explicit EndpointInfo(EndpointInfoPtr underlyingEndpoint) - : underlying(std::move(underlyingEndpoint)), + explicit EndpointInfo(EndpointInfoPtr underlyingInfo) + : underlying(std::move(underlyingInfo)), timeout(underlying->timeout), compress(underlying->compress) { @@ -226,7 +226,8 @@ namespace Ice // internal constructor WSEndpointInfo(EndpointInfoPtr underlying, std::string resource) - : EndpointInfo{std::move(underlying)}, resource{std::move(resource)} + : EndpointInfo{std::move(underlying)}, + resource{std::move(resource)} { } }; @@ -255,7 +256,10 @@ namespace Ice // internal constructor OpaqueEndpointInfo(std::int16_t type, Ice::EncodingVersion rawEncoding, std::vector rawBytes) - : EndpointInfo{-1, false}, rawEncoding{rawEncoding}, rawBytes{std::move(rawBytes)}, _type{type} + : EndpointInfo{-1, false}, + rawEncoding{rawEncoding}, + rawBytes{std::move(rawBytes)}, + _type{type} { } diff --git a/cpp/include/Ice/SSL/ConnectionInfo.h b/cpp/include/Ice/SSL/ConnectionInfo.h index d1aa5b9d3e0..439ff491231 100644 --- a/cpp/include/Ice/SSL/ConnectionInfo.h +++ b/cpp/include/Ice/SSL/ConnectionInfo.h @@ -9,6 +9,14 @@ #include "ConnectionInfoF.h" #include "Ice/Connection.h" +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wshadow-field-in-constructor" +#elif defined(__GNUC__) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wshadow" +#endif + // This file defines the `XxxConnectionInfo` class for each platform-specific SSL implementation. The // `#if defined(ICE_USE_XXX)/#endif` directives are used to include the appropriate structure based on the platform. We // avoid using `#elif` directives because, we want to define all the classes when building the doxygen documentation. @@ -28,7 +36,6 @@ namespace Ice::SSL class ICE_API SchannelConnectionInfo final : public Ice::ConnectionInfo { public: - SchannelConnectionInfo() = default; ~SchannelConnectionInfo() final; SchannelConnectionInfo(const SchannelConnectionInfo&) = delete; SchannelConnectionInfo& operator=(const SchannelConnectionInfo&) = delete; @@ -36,7 +43,14 @@ namespace Ice::SSL /** * The peer certificate. */ - PCCERT_CONTEXT peerCertificate = nullptr; + const PCCERT_CONTEXT peerCertificate; + + // internal constructor + SchannelConnectionInfo(Ice::ConnectionInfoPtr underlying, PCCERT_CONTEXT peerCertificate) + : ConnectionInfo{std::move(underlying)}, + peerCertificate{peerCertificate} + { + } }; #endif @@ -53,7 +67,6 @@ namespace Ice::SSL class ICE_API SecureTransportConnectionInfo final : public Ice::ConnectionInfo { public: - SecureTransportConnectionInfo() = default; ~SecureTransportConnectionInfo() final; SecureTransportConnectionInfo(const SecureTransportConnectionInfo&) = delete; SecureTransportConnectionInfo& operator=(const SecureTransportConnectionInfo&) = delete; @@ -61,7 +74,14 @@ namespace Ice::SSL /** * The peer certificate. */ - SecCertificateRef peerCertificate = nullptr; + const SecCertificateRef peerCertificate; + + // internal constructor + SecureTransportConnectionInfo(Ice::ConnectionInfoPtr underlying, SecCertificateRef peerCertificate) + : ConnectionInfo{std::move(underlying)}, + peerCertificate{peerCertificate} + { + } }; #endif @@ -78,7 +98,6 @@ namespace Ice::SSL class ICE_API OpenSSLConnectionInfo final : public Ice::ConnectionInfo { public: - OpenSSLConnectionInfo() = default; ~OpenSSLConnectionInfo() final; OpenSSLConnectionInfo(const OpenSSLConnectionInfo&) = delete; OpenSSLConnectionInfo& operator=(const OpenSSLConnectionInfo&) = delete; @@ -86,9 +105,22 @@ namespace Ice::SSL /** * The peer certificate. */ - X509* peerCertificate = nullptr; + X509* const peerCertificate; + + // internal constructor + OpenSSLConnectionInfo(Ice::ConnectionInfoPtr underlying, X509* peerCertificate) + : ConnectionInfo{std::move(underlying)}, + peerCertificate{peerCertificate} + { + } }; #endif } +#if defined(__clang__) +# pragma clang diagnostic pop +#elif defined(__GNUC__) +# pragma GCC diagnostic pop +#endif + #endif diff --git a/cpp/include/Ice/SSL/EndpointInfo.h b/cpp/include/Ice/SSL/EndpointInfo.h index f578b109064..237b281346c 100644 --- a/cpp/include/Ice/SSL/EndpointInfo.h +++ b/cpp/include/Ice/SSL/EndpointInfo.h @@ -27,10 +27,7 @@ namespace Ice::SSL EndpointInfo& operator=(const EndpointInfo&) = delete; // internal constructor - explicit EndpointInfo(Ice::EndpointInfoPtr underlying) - : Ice::EndpointInfo{std::move(underlying)} - { - } + explicit EndpointInfo(Ice::EndpointInfoPtr underlying) : Ice::EndpointInfo{std::move(underlying)} {} }; using EndpointInfoPtr = std::shared_ptr; diff --git a/cpp/include/Ice/ios/iAPConnectionInfo.h b/cpp/include/Ice/ios/iAPConnectionInfo.h index aa5c14e45c1..728a420906f 100644 --- a/cpp/include/Ice/ios/iAPConnectionInfo.h +++ b/cpp/include/Ice/ios/iAPConnectionInfo.h @@ -16,7 +16,6 @@ namespace IceIAP class ConnectionInfo final : public Ice::ConnectionInfo { public: - ConnectionInfo() = default; ~ConnectionInfo() final; ConnectionInfo(const ConnectionInfo&) = delete; ConnectionInfo& operator=(const ConnectionInfo&) = delete; @@ -24,27 +23,51 @@ namespace IceIAP /** * The accessory name. */ - std::string name; + const std::string name; + /** * The accessory manufacturer. */ - std::string manufacturer; + const std::string manufacturer; + /** * The accessory model number. */ - std::string modelNumber; + const std::string modelNumber; + /** * The accessory firmware revision. */ - std::string firmwareRevision; + const std::string firmwareRevision; + /** * The accessory hardware revision. */ - std::string hardwareRevision; + const std::string hardwareRevision; + /** * The protocol used by the accessory. */ - std::string protocol; + const std::string protocol; + + // internal constructor + ConnectionInfo( + std::string connectionId, + std::string name, + std::string manufacturer, + std::string modelNumber, + std::string firmwareRevision, + std::string hardwareRevision, + std::string protocol) + : Ice::ConnectionInfo{false, "", std::move(connectionId)}, + name{std::move(name)}, + manufacturer{std::move(manufacturer)}, + modelNumber{std::move(modelNumber)}, + firmwareRevision{std::move(firmwareRevision)}, + hardwareRevision{std::move(hardwareRevision)}, + protocol{std::move(protocol)} + { + } }; using ConnectionInfoPtr = std::shared_ptr; diff --git a/cpp/include/IceBT/ConnectionInfo.h b/cpp/include/IceBT/ConnectionInfo.h index fa7640542ce..ab06e28563b 100644 --- a/cpp/include/IceBT/ConnectionInfo.h +++ b/cpp/include/IceBT/ConnectionInfo.h @@ -8,16 +8,23 @@ #include "Ice/Connection.h" #include "Types.h" +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wshadow-field-in-constructor" +#elif defined(__GNUC__) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wshadow" +#endif + namespace IceBT { /** * Provides access to the details of a Bluetooth connection. * \headerfile IceBT/IceBT.h */ - class ICEBT_API ConnectionInfo : public Ice::ConnectionInfo + class ICEBT_API ConnectionInfo final : public Ice::ConnectionInfo { public: - ConnectionInfo() = default; ~ConnectionInfo() final; ConnectionInfo(const ConnectionInfo&) = delete; ConnectionInfo& operator=(const ConnectionInfo&) = delete; @@ -25,34 +32,75 @@ namespace IceBT /** * The local Bluetooth address. */ - std::string localAddress; + const std::string localAddress; + /** * The local RFCOMM channel. */ - int localChannel = -1; + const int localChannel; + /** * The remote Bluetooth address. */ - std::string remoteAddress; + const std::string remoteAddress; + /** * The remote RFCOMM channel. */ - int remoteChannel = -1; + const int remoteChannel; + /** * The UUID of the service being offered (in a server) or targeted (in a client). */ - std::string uuid; + const std::string uuid; + /** * The connection buffer receive size. */ - int rcvSize = 0; + const int rcvSize; + /** * The connection buffer send size. */ - int sndSize = 0; + const int sndSize; + + // internal constructor + ConnectionInfo( + bool incoming, + std::string adapterName, + std::string connectionId, + std::string localAddress, + int localChannel, + std::string remoteAddress, + int remoteChannel, + std::string uuid, + int rcvSize, + int sndSize) + : Ice::ConnectionInfo{incoming, std::move(adapterName), std::move(connectionId)}, + localAddress{std::move(localAddress)}, + localChannel{localChannel}, + remoteAddress{std::move(remoteAddress)}, + remoteChannel{remoteChannel}, + uuid{std::move(uuid)}, + rcvSize{rcvSize}, + sndSize{sndSize} + { + } + + // internal constructor + ConnectionInfo(bool incoming, std::string adapterName, std::string connectionId) + : ConnectionInfo{incoming, std::move(adapterName), std::move(connectionId), "", -1, "", -1, "", 0, 0} + { + } }; using ConnectionInfoPtr = std::shared_ptr; } +#if defined(__clang__) +# pragma clang diagnostic pop +#elif defined(__GNUC__) +# pragma GCC diagnostic pop +#endif + #endif diff --git a/cpp/include/IceBT/EndpointInfo.h b/cpp/include/IceBT/EndpointInfo.h index 3e204d5b657..401e1637a86 100644 --- a/cpp/include/IceBT/EndpointInfo.h +++ b/cpp/include/IceBT/EndpointInfo.h @@ -42,13 +42,7 @@ namespace IceBT const std::string uuid; // internal constructor - EndpointInfo( - int timeout, - bool compress, - std::string addr, - std::string uuid, - std::int16_t type, - bool secure) + EndpointInfo(int timeout, bool compress, std::string addr, std::string uuid, std::int16_t type, bool secure) : Ice::EndpointInfo{timeout, compress}, addr{std::move(addr)}, uuid{std::move(uuid)}, @@ -57,9 +51,9 @@ namespace IceBT { } - private: - const std::int16_t _type; - const bool _secure; + private: + const std::int16_t _type; + const bool _secure; }; using EndpointInfoPtr = std::shared_ptr; diff --git a/cpp/src/Ice/ConnectionI.cpp b/cpp/src/Ice/ConnectionI.cpp index c5a5b47939c..3a4b1f6440a 100644 --- a/cpp/src/Ice/ConnectionI.cpp +++ b/cpp/src/Ice/ConnectionI.cpp @@ -3493,28 +3493,17 @@ Ice::ConnectionI::dispatchAll( Ice::ConnectionInfoPtr Ice::ConnectionI::initConnectionInfo() const { + // Called with _mutex locked. + if (_state > StateNotInitialized && _info) // Update the connection information until it's initialized { return _info; } - try - { - _info = _transceiver->getInfo(); - } - catch (const Ice::LocalException&) - { - _info = std::make_shared(); - } - - Ice::ConnectionInfoPtr info = _info; - while (info) - { - info->connectionId = _endpoint->connectionId(); - info->incoming = _connector == 0; - info->adapterName = _adapter ? _adapter->getName() : string(); - info = info->underlying; - } + _info = _transceiver->getInfo( + _connector == nullptr, + _adapter ? _adapter->getName() : string{}, + _endpoint->connectionId()); return _info; } diff --git a/cpp/src/Ice/IdleTimeoutTransceiverDecorator.h b/cpp/src/Ice/IdleTimeoutTransceiverDecorator.h index ca03f267f63..75ce5ce19ba 100644 --- a/cpp/src/Ice/IdleTimeoutTransceiverDecorator.h +++ b/cpp/src/Ice/IdleTimeoutTransceiverDecorator.h @@ -60,7 +60,12 @@ namespace IceInternal std::string protocol() const final { return _decoratee->protocol(); } std::string toString() const final { return _decoratee->toString(); } std::string toDetailedString() const final { return _decoratee->toDetailedString(); } - Ice::ConnectionInfoPtr getInfo() const final { return _decoratee->getInfo(); } + + Ice::ConnectionInfoPtr getInfo(bool incoming, std::string adapterName, std::string connectionId) const final + { + return _decoratee->getInfo(incoming, std::move(adapterName), std::move(connectionId)); + } + void checkSendSize(const Buffer& buf) final { _decoratee->checkSendSize(buf); }; void setBufferSize(int rcvSize, int sndSize) final { _decoratee->setBufferSize(rcvSize, sndSize); } diff --git a/cpp/src/Ice/SSL/OpenSSLTransceiverI.cpp b/cpp/src/Ice/SSL/OpenSSLTransceiverI.cpp index d498a397ee4..03d111cffc1 100644 --- a/cpp/src/Ice/SSL/OpenSSLTransceiverI.cpp +++ b/cpp/src/Ice/SSL/OpenSSLTransceiverI.cpp @@ -598,21 +598,20 @@ OpenSSL::TransceiverI::toDetailedString() const } Ice::ConnectionInfoPtr -OpenSSL::TransceiverI::getInfo() const +OpenSSL::TransceiverI::getInfo(bool incoming, string adapterName, string connectionId) const { - auto info = std::make_shared(); - info->underlying = _delegate->getInfo(); - info->incoming = _incoming; - info->adapterName = _adapterName; + assert(incoming == _incoming); + assert(adapterName == _adapterName); + + X509* peerCertificate = nullptr; if (_peerCertificate) { - info->peerCertificate = X509_dup(_peerCertificate); - } - else - { - info->peerCertificate = nullptr; + peerCertificate = X509_dup(_peerCertificate); } - return info; + + return make_shared( + _delegate->getInfo(incoming, std::move(adapterName), std::move(connectionId)), + peerCertificate); } void @@ -642,8 +641,10 @@ OpenSSL::TransceiverI::verifyCallback(int ok, X509_STORE_CTX* ctx) sk_X509_pop_free(chain, X509_free); } } - bool verified = - _remoteCertificateVerificationCallback(ok, ctx, dynamic_pointer_cast(getInfo())); + bool verified = _remoteCertificateVerificationCallback( + ok, + ctx, + dynamic_pointer_cast(getInfo(_incoming, _adapterName, ""))); if (!verified) { long result = SSL_get_verify_result(_ssl); diff --git a/cpp/src/Ice/SSL/OpenSSLTransceiverI.h b/cpp/src/Ice/SSL/OpenSSLTransceiverI.h index f13013c38eb..6d7265cd59b 100644 --- a/cpp/src/Ice/SSL/OpenSSLTransceiverI.h +++ b/cpp/src/Ice/SSL/OpenSSLTransceiverI.h @@ -47,7 +47,7 @@ namespace Ice::SSL::OpenSSL std::string protocol() const final; std::string toString() const final; std::string toDetailedString() const final; - Ice::ConnectionInfoPtr getInfo() const final; + Ice::ConnectionInfoPtr getInfo(bool incoming, std::string adapterName, std::string connectionId) const final; void checkSendSize(const IceInternal::Buffer&) final; void setBufferSize(int rcvSize, int sndSize) final; diff --git a/cpp/src/Ice/SSL/SSLEndpointI.cpp b/cpp/src/Ice/SSL/SSLEndpointI.cpp index 3e270812168..145939ae8f4 100644 --- a/cpp/src/Ice/SSL/SSLEndpointI.cpp +++ b/cpp/src/Ice/SSL/SSLEndpointI.cpp @@ -56,7 +56,6 @@ Ice::SSL::SchannelConnectionInfo::~SchannelConnectionInfo() if (peerCertificate) { CertFreeCertificateContext(peerCertificate); - peerCertificate = nullptr; } } #elif defined(ICE_USE_SECURE_TRANSPORT) @@ -65,7 +64,6 @@ Ice::SSL::SecureTransportConnectionInfo::~SecureTransportConnectionInfo() if (peerCertificate) { CFRelease(peerCertificate); - peerCertificate = nullptr; } } #else @@ -74,7 +72,6 @@ Ice::SSL::OpenSSLConnectionInfo::~OpenSSLConnectionInfo() if (peerCertificate) { X509_free(peerCertificate); - peerCertificate = nullptr; } } #endif diff --git a/cpp/src/Ice/SSL/SchannelTransceiverI.cpp b/cpp/src/Ice/SSL/SchannelTransceiverI.cpp index e4674cf92d8..22adf4c5275 100644 --- a/cpp/src/Ice/SSL/SchannelTransceiverI.cpp +++ b/cpp/src/Ice/SSL/SchannelTransceiverI.cpp @@ -472,7 +472,9 @@ Schannel::TransceiverI::sslHandshake(SecBuffer* initialBuffer) _writeBuffer.i = _writeBuffer.b.begin(); if (_remoteCertificateValidationCallback && - !_remoteCertificateValidationCallback(_ssl, dynamic_pointer_cast(getInfo()))) + !_remoteCertificateValidationCallback( + _ssl, + dynamic_pointer_cast(getInfo(_incoming, _adapterName, "")))) { throw SecurityException( __FILE__, @@ -928,14 +930,14 @@ Schannel::TransceiverI::toDetailedString() const } Ice::ConnectionInfoPtr -Schannel::TransceiverI::getInfo() const +Schannel::TransceiverI::getInfo(bool incoming, string adapterName, string connectionId) const { - auto info = std::make_shared(); - info->underlying = _delegate->getInfo(); - info->incoming = _incoming; - info->adapterName = _adapterName; - info->peerCertificate = CertDuplicateCertificateContext(_peerCertificate); - return info; + assert(incoming == _incoming); + assert(adapterName == _adapterName); + + return make_shared( + _delegate->getInfo(incoming, std::move(adapterName), std::move(connectionId)), + CertDuplicateCertificateContext(_peerCertificate)); } void diff --git a/cpp/src/Ice/SSL/SchannelTransceiverI.h b/cpp/src/Ice/SSL/SchannelTransceiverI.h index f874f29583e..1e8621d6cb0 100644 --- a/cpp/src/Ice/SSL/SchannelTransceiverI.h +++ b/cpp/src/Ice/SSL/SchannelTransceiverI.h @@ -46,7 +46,7 @@ namespace Ice::SSL::Schannel std::string protocol() const final; std::string toString() const final; std::string toDetailedString() const final; - Ice::ConnectionInfoPtr getInfo() const final; + Ice::ConnectionInfoPtr getInfo(bool incoming, std::string adapterName, std::string connectionId) const final; void checkSendSize(const IceInternal::Buffer&) final; void setBufferSize(int rcvSize, int sndSize) final; diff --git a/cpp/src/Ice/SSL/SecureTransportTransceiverI.cpp b/cpp/src/Ice/SSL/SecureTransportTransceiverI.cpp index e8db8a88149..3a56c5d3d3b 100644 --- a/cpp/src/Ice/SSL/SecureTransportTransceiverI.cpp +++ b/cpp/src/Ice/SSL/SecureTransportTransceiverI.cpp @@ -230,7 +230,7 @@ Ice::SSL::SecureTransport::TransceiverI::initialize(IceInternal::Buffer& readBuf if (remoteCertificateValidationCallback( _trust.get(), - dynamic_pointer_cast(getInfo()))) + dynamic_pointer_cast(getInfo(_incoming, _adapterName, "")))) { continue; // Call SSLHandshake to resume the handshake. } @@ -503,24 +503,22 @@ Ice::SSL::SecureTransport::TransceiverI::toDetailedString() const } Ice::ConnectionInfoPtr -Ice::SSL::SecureTransport::TransceiverI::getInfo() const +Ice::SSL::SecureTransport::TransceiverI::getInfo(bool incoming, string adapterName, string connectionId) const { - auto info = make_shared(); - info->underlying = _delegate->getInfo(); - info->incoming = _incoming; - info->adapterName = _adapterName; + assert(incoming == _incoming); + assert(adapterName == _adapterName); + + SecCertificateRef peerCertificate = nullptr; + if (_peerCertificate) { - SecCertificateRef peerCertificate = _peerCertificate.get(); + peerCertificate = _peerCertificate.get(); CFRetain(peerCertificate); - info->peerCertificate = peerCertificate; - } - else - { - info->peerCertificate = nullptr; } - return info; + return make_shared( + _delegate->getInfo(incoming, std::move(adapterName), std::move(connectionId)), + peerCertificate); } void diff --git a/cpp/src/Ice/SSL/SecureTransportTransceiverI.h b/cpp/src/Ice/SSL/SecureTransportTransceiverI.h index a63f6f505d6..54e1d79b571 100644 --- a/cpp/src/Ice/SSL/SecureTransportTransceiverI.h +++ b/cpp/src/Ice/SSL/SecureTransportTransceiverI.h @@ -47,7 +47,7 @@ namespace Ice::SSL::SecureTransport std::string protocol() const final; std::string toString() const final; std::string toDetailedString() const final; - Ice::ConnectionInfoPtr getInfo() const final; + Ice::ConnectionInfoPtr getInfo(bool incoming, std::string adapterName, std::string connectionId) const final; void checkSendSize(const IceInternal::Buffer&) final; void setBufferSize(int rcvSize, int sndSize) final; diff --git a/cpp/src/Ice/TcpEndpointI.cpp b/cpp/src/Ice/TcpEndpointI.cpp index a3378ef17d9..7574c068e99 100644 --- a/cpp/src/Ice/TcpEndpointI.cpp +++ b/cpp/src/Ice/TcpEndpointI.cpp @@ -73,7 +73,14 @@ IceInternal::TcpEndpointI::streamWriteImpl(OutputStream* s) const EndpointInfoPtr IceInternal::TcpEndpointI::getInfo() const noexcept { - return make_shared(_timeout, _compress, _host, _port, inetAddrToString(_sourceAddr), type(), secure()); + return make_shared( + _timeout, + _compress, + _host, + _port, + inetAddrToString(_sourceAddr), + type(), + secure()); } int32_t diff --git a/cpp/src/Ice/TcpTransceiver.cpp b/cpp/src/Ice/TcpTransceiver.cpp index f33e5f8598a..1105283bd71 100644 --- a/cpp/src/Ice/TcpTransceiver.cpp +++ b/cpp/src/Ice/TcpTransceiver.cpp @@ -100,16 +100,30 @@ IceInternal::TcpTransceiver::toDetailedString() const } Ice::ConnectionInfoPtr -IceInternal::TcpTransceiver::getInfo() const +IceInternal::TcpTransceiver::getInfo(bool incoming, string adapterName, string connectionId) const { - TCPConnectionInfoPtr info = std::make_shared(); - fdToAddressAndPort(_stream->fd(), info->localAddress, info->localPort, info->remoteAddress, info->remotePort); - if (_stream->fd() != INVALID_SOCKET) + if (_stream->fd() == INVALID_SOCKET) { - info->rcvSize = getRecvBufferSize(_stream->fd()); - info->sndSize = getSendBufferSize(_stream->fd()); + return make_shared(incoming, std::move(adapterName), std::move(connectionId)); + } + else + { + string localAddress; + int localPort; + string remoteAddress; + int remotePort; + fdToAddressAndPort(_stream->fd(), localAddress, localPort, remoteAddress, remotePort); + return make_shared( + incoming, + std::move(adapterName), + std::move(connectionId), + std::move(localAddress), + localPort, + std::move(remoteAddress), + remotePort, + getRecvBufferSize(_stream->fd()), + getSendBufferSize(_stream->fd())); } - return info; } void diff --git a/cpp/src/Ice/TcpTransceiver.h b/cpp/src/Ice/TcpTransceiver.h index 0a72c2fa470..7d7bab0a5f5 100644 --- a/cpp/src/Ice/TcpTransceiver.h +++ b/cpp/src/Ice/TcpTransceiver.h @@ -38,7 +38,7 @@ namespace IceInternal std::string protocol() const final; std::string toString() const final; std::string toDetailedString() const final; - Ice::ConnectionInfoPtr getInfo() const final; + Ice::ConnectionInfoPtr getInfo(bool incoming, std::string adapterName, std::string connectionId) const final; void checkSendSize(const Buffer&) final; void setBufferSize(int rcvSize, int sndSize) final; diff --git a/cpp/src/Ice/Transceiver.h b/cpp/src/Ice/Transceiver.h index afba38f4b35..4c5d1699cf8 100644 --- a/cpp/src/Ice/Transceiver.h +++ b/cpp/src/Ice/Transceiver.h @@ -37,7 +37,8 @@ namespace IceInternal virtual std::string protocol() const = 0; virtual std::string toString() const = 0; virtual std::string toDetailedString() const = 0; - virtual Ice::ConnectionInfoPtr getInfo() const = 0; + virtual Ice::ConnectionInfoPtr + getInfo(bool incoming, std::string adapterName, std::string connectionId) const = 0; virtual void checkSendSize(const Buffer&) = 0; virtual void setBufferSize(int, int) = 0; }; diff --git a/cpp/src/Ice/UdpEndpointI.cpp b/cpp/src/Ice/UdpEndpointI.cpp index 01501b0a586..331c0a121e1 100644 --- a/cpp/src/Ice/UdpEndpointI.cpp +++ b/cpp/src/Ice/UdpEndpointI.cpp @@ -97,7 +97,13 @@ IceInternal::UdpEndpointI::streamWriteImpl(OutputStream* s) const EndpointInfoPtr IceInternal::UdpEndpointI::getInfo() const noexcept { - return make_shared(_compress, _host, _port, inetAddrToString(_sourceAddr), _mcastInterface, _mcastTtl); + return make_shared( + _compress, + _host, + _port, + inetAddrToString(_sourceAddr), + _mcastInterface, + _mcastTtl); } int32_t diff --git a/cpp/src/Ice/UdpTransceiver.cpp b/cpp/src/Ice/UdpTransceiver.cpp index 0ccf6797740..5f733fd90c2 100644 --- a/cpp/src/Ice/UdpTransceiver.cpp +++ b/cpp/src/Ice/UdpTransceiver.cpp @@ -533,45 +533,81 @@ IceInternal::UdpTransceiver::toDetailedString() const } Ice::ConnectionInfoPtr -IceInternal::UdpTransceiver::getInfo() const +IceInternal::UdpTransceiver::getInfo(bool incoming, string adapterName, string connectionId) const { - auto info = make_shared(); if (_fd == INVALID_SOCKET) { - return info; + return make_shared(incoming, std::move(adapterName), std::move(connectionId)); } - - if (_state == StateNotConnected) + else { - Address localAddr; - fdToLocalAddress(_fd, localAddr); - addrToAddressAndPort(localAddr, info->localAddress, info->localPort); - if (isAddressValid(_peerAddr)) + // TODO: remove these states + + if (_state == StateNotConnected) { - addrToAddressAndPort(_peerAddr, info->remoteAddress, info->remotePort); + Address localAddr; + fdToLocalAddress(_fd, localAddr); + + string localAddress; + int localPort; + addrToAddressAndPort(localAddr, localAddress, localPort); + + string remoteAddress; + int remotePort = 0; + if (isAddressValid(_peerAddr)) + { + addrToAddressAndPort(_peerAddr, remoteAddress, remotePort); + } + + string mcastAddress; + int mcastPort = 0; + if (isAddressValid(_mcastAddr)) + { + addrToAddressAndPort(_mcastAddr, mcastAddress, mcastPort); + } + + return make_shared( + incoming, + std::move(adapterName), + std::move(connectionId), + std::move(localAddress), + localPort, + std::move(remoteAddress), + remotePort, + std::move(mcastAddress), + mcastPort, + _rcvSize, + _sndSize); } else { - info->remotePort = 0; - } - } - else - { - fdToAddressAndPort(_fd, info->localAddress, info->localPort, info->remoteAddress, info->remotePort); - } - - info->rcvSize = _rcvSize; - info->sndSize = _sndSize; + string localAddress; + int localPort; + string remoteAddress; + int remotePort; + fdToAddressAndPort(_fd, localAddress, localPort, remoteAddress, remotePort); + + string mcastAddress; + int mcastPort = 0; + if (isAddressValid(_mcastAddr)) + { + addrToAddressAndPort(_mcastAddr, mcastAddress, mcastPort); + } - if (isAddressValid(_mcastAddr)) - { - addrToAddressAndPort(_mcastAddr, info->mcastAddress, info->mcastPort); - } - else - { - info->mcastPort = 0; + return make_shared( + incoming, + std::move(adapterName), + std::move(connectionId), + std::move(localAddress), + localPort, + std::move(remoteAddress), + remotePort, + std::move(mcastAddress), + mcastPort, + _rcvSize, + _sndSize); + } } - return info; } void diff --git a/cpp/src/Ice/UdpTransceiver.h b/cpp/src/Ice/UdpTransceiver.h index 8533e7179e6..d995fd53c26 100644 --- a/cpp/src/Ice/UdpTransceiver.h +++ b/cpp/src/Ice/UdpTransceiver.h @@ -57,7 +57,7 @@ namespace IceInternal std::string protocol() const final; std::string toString() const final; std::string toDetailedString() const final; - Ice::ConnectionInfoPtr getInfo() const final; + Ice::ConnectionInfoPtr getInfo(bool incoming, std::string adapterName, std::string connectionId) const final; void checkSendSize(const Buffer&) final; void setBufferSize(int rcvSize, int sndSize) final; diff --git a/cpp/src/Ice/WSTransceiver.cpp b/cpp/src/Ice/WSTransceiver.cpp index d667d4202f7..f47c282e521 100644 --- a/cpp/src/Ice/WSTransceiver.cpp +++ b/cpp/src/Ice/WSTransceiver.cpp @@ -796,12 +796,11 @@ IceInternal::WSTransceiver::toDetailedString() const } Ice::ConnectionInfoPtr -IceInternal::WSTransceiver::getInfo() const +IceInternal::WSTransceiver::getInfo(bool incoming, string adapterName, string connectionId) const { - WSConnectionInfoPtr info = std::make_shared(); - info->underlying = _delegate->getInfo(); - info->headers = _parser->getHeaders(); - return info; + return make_shared( + _delegate->getInfo(incoming, std::move(adapterName), std::move(connectionId)), + _parser->getHeaders()); } void diff --git a/cpp/src/Ice/WSTransceiver.h b/cpp/src/Ice/WSTransceiver.h index e1ec15f0241..53c5a3d7efc 100644 --- a/cpp/src/Ice/WSTransceiver.h +++ b/cpp/src/Ice/WSTransceiver.h @@ -44,7 +44,7 @@ namespace IceInternal std::string protocol() const final; std::string toString() const final; std::string toDetailedString() const final; - Ice::ConnectionInfoPtr getInfo() const final; + Ice::ConnectionInfoPtr getInfo(bool incoming, std::string adapterName, std::string connectionId) const final; void checkSendSize(const Buffer&) final; void setBufferSize(int rcvSize, int sndSize) final; diff --git a/cpp/src/Ice/ios/StreamEndpointI.cpp b/cpp/src/Ice/ios/StreamEndpointI.cpp index 3d6d5a9371c..7b61cc5c854 100644 --- a/cpp/src/Ice/ios/StreamEndpointI.cpp +++ b/cpp/src/Ice/ios/StreamEndpointI.cpp @@ -146,7 +146,14 @@ IceObjC::StreamEndpointI::StreamEndpointI(const InstancePtr& instance, Ice::Inpu EndpointInfoPtr IceObjC::StreamEndpointI::getInfo() const noexcept { - return make_shared(_timeout, _compress, _host, _port, inetAddrToString(_sourceAddr), type(), secure()); + return make_shared( + _timeout, + _compress, + _host, + _port, + inetAddrToString(_sourceAddr), + type(), + secure()); } int32_t diff --git a/cpp/src/Ice/ios/StreamTransceiver.cpp b/cpp/src/Ice/ios/StreamTransceiver.cpp index 184147cac05..be6be56b727 100644 --- a/cpp/src/Ice/ios/StreamTransceiver.cpp +++ b/cpp/src/Ice/ios/StreamTransceiver.cpp @@ -439,13 +439,31 @@ IceObjC::StreamTransceiver::toDetailedString() const } Ice::ConnectionInfoPtr -IceObjC::StreamTransceiver::getInfo() const +IceObjC::StreamTransceiver::getInfo(bool incoming, string adapterName, string connectionId) const { - auto info = make_shared(); - fdToAddressAndPort(_fd, info->localAddress, info->localPort, info->remoteAddress, info->remotePort); - info->rcvSize = getRecvBufferSize(_fd); - info->sndSize = getSendBufferSize(_fd); - return info; + if (_fd == INVALID_SOCKET) + { + return make_shared(incoming, std::move(adapterName), std::move(connectionId)); + } + else + { + string localAddress; + int localPort; + string remoteAddres; + int remotePort; + fdToAddressAndPort(_fd, info->localAddress, info->localPort, info->remoteAddress, info->remotePort); + + return make_shared( + incoming, + std::move(adapterName), + std::move(connectionId), + std::move(localAddress), + localPort, + std::move(remoteAddress), + remotePort, + getRecvBufferSize(_fd), + getSendBufferSize(_fd)); + } } void diff --git a/cpp/src/Ice/ios/StreamTransceiver.h b/cpp/src/Ice/ios/StreamTransceiver.h index efa6a9bcc3b..be951e6b8a8 100644 --- a/cpp/src/Ice/ios/StreamTransceiver.h +++ b/cpp/src/Ice/ios/StreamTransceiver.h @@ -62,7 +62,7 @@ namespace IceObjC std::string protocol() const final; std::string toString() const final; std::string toDetailedString() const final; - Ice::ConnectionInfoPtr getInfo() const final; + Ice::ConnectionInfoPtr getInfo(bool incoming, std::string adapterName, std::string connectionId) const final; void checkSendSize(const IceInternal::Buffer&) final; void setBufferSize(int, int) final; diff --git a/cpp/src/Ice/ios/iAPTransceiver.h b/cpp/src/Ice/ios/iAPTransceiver.h index 1149ac751dc..3d33418a469 100644 --- a/cpp/src/Ice/ios/iAPTransceiver.h +++ b/cpp/src/Ice/ios/iAPTransceiver.h @@ -49,7 +49,7 @@ namespace IceObjC std::string protocol() const final; std::string toString() const final; std::string toDetailedString() const final; - Ice::ConnectionInfoPtr getInfo() const final; + Ice::ConnectionInfoPtr getInfo(bool incoming, std::string adapterName, std::string connectionId) const final; void checkSendSize(const IceInternal::Buffer&) final; void setBufferSize(int, int) final; diff --git a/cpp/src/Ice/ios/iAPTransceiver.mm b/cpp/src/Ice/ios/iAPTransceiver.mm index 6e680d32193..b953ed74147 100644 --- a/cpp/src/Ice/ios/iAPTransceiver.mm +++ b/cpp/src/Ice/ios/iAPTransceiver.mm @@ -380,16 +380,19 @@ - (void)stream:(NSStream*)stream handleEvent:(NSStreamEvent)eventCode } Ice::ConnectionInfoPtr -IceObjC::iAPTransceiver::getInfo() const +IceObjC::iAPTransceiver::getInfo(bool incoming, string adapterName, string connectionId) const { - IceIAP::ConnectionInfoPtr info = make_shared(); - info->manufacturer = [_session.accessory.manufacturer UTF8String]; - info->name = [_session.accessory.name UTF8String]; - info->modelNumber = [_session.accessory.modelNumber UTF8String]; - info->firmwareRevision = [_session.accessory.firmwareRevision UTF8String]; - info->hardwareRevision = [_session.accessory.hardwareRevision UTF8String]; - info->protocol = [_session.protocolString UTF8String]; - return info; + assert(!incoming); + assert(adapterName.empty()); + + return make_shared( + std::move(connectionId), + [_session.accessory.name UTF8String], + [_session.accessory.manufacturer UTF8String], + [_session.accessory.modelNumber UTF8String], + [_session.accessory.firmwareRevision UTF8String], + [_session.accessory.hardwareRevision UTF8String], + [_session.protocolString UTF8String]); } void diff --git a/cpp/src/IceBT/TransceiverI.cpp b/cpp/src/IceBT/TransceiverI.cpp index 8ca0208c55a..4ae9e22bb48 100644 --- a/cpp/src/IceBT/TransceiverI.cpp +++ b/cpp/src/IceBT/TransceiverI.cpp @@ -115,22 +115,32 @@ IceBT::TransceiverI::toDetailedString() const } Ice::ConnectionInfoPtr -IceBT::TransceiverI::getInfo() const -{ - auto info = make_shared(); - fdToAddressAndChannel( - _stream->fd(), - info->localAddress, - info->localChannel, - info->remoteAddress, - info->remoteChannel); - if (_stream->fd() != INVALID_SOCKET) +IceBT::TransceiverI::getInfo(bool incoming, string adapterName, string connectionId) const +{ + if (_stream->fd() == INVALID_SOCKET) + { + return make_shared(incoming, move(adapterName), move(connectionId)); + } + else { - info->rcvSize = IceInternal::getRecvBufferSize(_stream->fd()); - info->sndSize = IceInternal::getSendBufferSize(_stream->fd()); + string localAddress; + int localChannel; + string remoteAddress; + int remoteChannel; + fdToAddressAndChannel(_stream->fd(), localAddress, localChannel, remoteAddress, remoteChannel); + + return make_shared( + incoming, + std::move(adapterName), + std::move(connectionId), + std::move(localAddress), + localChannel, + std::move(remoteAddress), + remoteChannel, + _uuid, + IceInternal::getRecvBufferSize(_stream->fd()), + IceInternal::getSendBufferSize(_stream->fd())); } - info->uuid = _uuid; - return info; } void diff --git a/cpp/src/IceBT/TransceiverI.h b/cpp/src/IceBT/TransceiverI.h index 40c4dd046e3..c28a48b7154 100644 --- a/cpp/src/IceBT/TransceiverI.h +++ b/cpp/src/IceBT/TransceiverI.h @@ -32,7 +32,7 @@ namespace IceBT std::string protocol() const final; std::string toString() const final; std::string toDetailedString() const final; - Ice::ConnectionInfoPtr getInfo() const final; + Ice::ConnectionInfoPtr getInfo(bool incoming, std::string adapterName, std::string connectionId) const final; void checkSendSize(const IceInternal::Buffer&) final; void setBufferSize(int rcvSize, int sndSize) final; diff --git a/cpp/test/Ice/background/Transceiver.cpp b/cpp/test/Ice/background/Transceiver.cpp index e21d994c0d0..22e6ec52462 100644 --- a/cpp/test/Ice/background/Transceiver.cpp +++ b/cpp/test/Ice/background/Transceiver.cpp @@ -231,9 +231,9 @@ Transceiver::toDetailedString() const } Ice::ConnectionInfoPtr -Transceiver::getInfo() const +Transceiver::getInfo(bool incoming, string adapterName, string connectionId) const { - return _transceiver->getInfo(); + return _transceiver->getInfo(incoming, std::move(adapterName), std::move(connectionId)); } void diff --git a/cpp/test/Ice/background/Transceiver.h b/cpp/test/Ice/background/Transceiver.h index d0100d5fd8a..b77690bf17e 100644 --- a/cpp/test/Ice/background/Transceiver.h +++ b/cpp/test/Ice/background/Transceiver.h @@ -28,7 +28,7 @@ class Transceiver final : public IceInternal::Transceiver std::string protocol() const final; std::string toString() const final; std::string toDetailedString() const final; - Ice::ConnectionInfoPtr getInfo() const final; + Ice::ConnectionInfoPtr getInfo(bool incoming, std::string adapterName, std::string connectionId) const final; IceInternal::SocketOperation initialize(IceInternal::Buffer&, IceInternal::Buffer&) final; void checkSendSize(const IceInternal::Buffer&) final; void setBufferSize(int rcvSize, int sndSize) final;