diff --git a/Net/include/Poco/Net/SocketImpl.h b/Net/include/Poco/Net/SocketImpl.h index ad94ebf5c..1c7e5e442 100644 --- a/Net/include/Poco/Net/SocketImpl.h +++ b/Net/include/Poco/Net/SocketImpl.h @@ -85,7 +85,7 @@ public: /// If reuseAddress is true, sets the SO_REUSEADDR /// socket option. - virtual void bind(const SocketAddress& address, bool reuseAddress, bool reusePort ); + virtual void bind(const SocketAddress& address, bool reuseAddress, bool reusePort); /// Bind a local address to the socket. /// /// This is usually only done when establishing a server @@ -115,7 +115,7 @@ public: /// If the library has not been built with IPv6 support, /// a Poco::NotImplementedException will be thrown. - virtual void bind6(const SocketAddress& address, bool reuseAddress, bool reusePort, bool ipV6Only); + virtual void bind6(const SocketAddress& address, bool reuseAddress, bool reusePort, bool ipV6Only); /// Bind a local IPv6 address to the socket. /// /// This is usually only done when establishing a server diff --git a/NetSSL_OpenSSL/include/Poco/Net/SecureServerSocketImpl.h b/NetSSL_OpenSSL/include/Poco/Net/SecureServerSocketImpl.h index 550e40759..00b29fc21 100644 --- a/NetSSL_OpenSSL/include/Poco/Net/SecureServerSocketImpl.h +++ b/NetSSL_OpenSSL/include/Poco/Net/SecureServerSocketImpl.h @@ -47,7 +47,7 @@ public: /// with the client. /// /// The client socket's address is returned in clientAddr. - + void connect(const SocketAddress& address); /// Not supported by this kind of socket. /// @@ -62,8 +62,18 @@ public: /// Not supported by this kind of socket. /// /// Throws a Poco::InvalidAccessException. - - void bind(const SocketAddress& address, bool reuseAddress = false, bool reusePort = false); + + void bind(const SocketAddress& address, bool reuseAddress = false); + /// Bind a local address to the socket. + /// + /// This is usually only done when establishing a server + /// socket. TCP clients should not bind a socket to a + /// specific address. + /// + /// If reuseAddress is true, sets the SO_REUSEADDR + /// socket option. + + void bind(const SocketAddress& address, bool reuseAddress, bool reusePort); /// Bind a local address to the socket. /// /// This is usually only done when establishing a server @@ -76,7 +86,43 @@ public: /// If reusePort is true, sets the SO_REUSEPORT /// socket option. - + void bind6(const SocketAddress& address, bool reuseAddress = false, bool ipV6Only = false); + /// Bind a local IPv6 address to the socket. + /// + /// This is usually only done when establishing a server + /// socket. TCP clients should not bind a socket to a + /// specific address. + /// + /// If reuseAddress is true, sets the SO_REUSEADDR + /// socket option. + /// + /// The given address must be an IPv6 address. The + /// IPPROTO_IPV6/IPV6_V6ONLY option is set on the socket + /// according to the ipV6Only parameter. + /// + /// If the library has not been built with IPv6 support, + /// a Poco::NotImplementedException will be thrown. + + void bind6(const SocketAddress& address, bool reuseAddress, bool reusePort, bool ipV6Only); + /// Bind a local IPv6 address to the socket. + /// + /// This is usually only done when establishing a server + /// socket. TCP clients should not bind a socket to a + /// specific address. + /// + /// If reuseAddress is true, sets the SO_REUSEADDR + /// socket option. + /// + /// If reusePort is true, sets the SO_REUSEPORT + /// socket option. + /// + /// The given address must be an IPv6 address. The + /// IPPROTO_IPV6/IPV6_V6ONLY option is set on the socket + /// according to the ipV6Only parameter. + /// + /// If the library has not been built with IPv6 support, + /// a Poco::NotImplementedException will be thrown. + void listen(int backlog = 64); /// Puts the socket into listening state. /// @@ -89,27 +135,27 @@ public: void close(); /// Close the socket. - + int sendBytes(const void* buffer, int length, int flags = 0); /// Not supported by this kind of socket. /// /// Throws a Poco::InvalidAccessException. - + int receiveBytes(void* buffer, int length, int flags = 0); /// Not supported by this kind of socket. /// /// Throws a Poco::InvalidAccessException. - + int sendTo(const void* buffer, int length, const SocketAddress& address, int flags = 0); /// Not supported by this kind of socket. /// /// Throws a Poco::InvalidAccessException. - + int receiveFrom(void* buffer, int length, SocketAddress& address, int flags = 0); /// Not supported by this kind of socket. /// /// Throws a Poco::InvalidAccessException. - + void sendUrgent(unsigned char data); /// Not supported by this kind of socket. /// @@ -118,7 +164,7 @@ public: bool secure() const; /// Returns true iff the socket's connection is secure /// (using SSL or TLS). - + Context::Ptr context() const; /// Returns the SSL context used by this socket. diff --git a/NetSSL_OpenSSL/include/Poco/Net/SecureSocketImpl.h b/NetSSL_OpenSSL/include/Poco/Net/SecureSocketImpl.h index bbc4c2273..5940ae598 100644 --- a/NetSSL_OpenSSL/include/Poco/Net/SecureSocketImpl.h +++ b/NetSSL_OpenSSL/include/Poco/Net/SecureSocketImpl.h @@ -56,29 +56,39 @@ public: /// with the client. /// /// The client socket's address is returned in clientAddr. - + void connect(const SocketAddress& address, bool performHandshake); - /// Initializes the socket and establishes a secure connection to + /// Initializes the socket and establishes a secure connection to /// the TCP server at the given address. /// - /// If performHandshake is true, the SSL handshake is performed immediately + /// If performHandshake is true, the SSL handshake is performed immediately /// after establishing the connection. Otherwise, the handshake is performed /// the first time sendBytes(), receiveBytes() or completeHandshake() is called. void connect(const SocketAddress& address, const Poco::Timespan& timeout, bool performHandshake); - /// Initializes the socket, sets the socket timeout and + /// Initializes the socket, sets the socket timeout and /// establishes a secure connection to the TCP server at the given address. /// - /// If performHandshake is true, the SSL handshake is performed immediately + /// If performHandshake is true, the SSL handshake is performed immediately /// after establishing the connection. Otherwise, the handshake is performed /// the first time sendBytes(), receiveBytes() or completeHandshake() is called. void connectNB(const SocketAddress& address); - /// Initializes the socket and establishes a secure connection to + /// Initializes the socket and establishes a secure connection to /// the TCP server at the given address. Prior to opening the /// connection the socket is set to nonblocking mode. - void bind(const SocketAddress& address, bool reuseAddress = false, bool reusePort = false); + void bind(const SocketAddress& address, bool reuseAddress = false); + /// Bind a local address to the socket. + /// + /// This is usually only done when establishing a server + /// socket. TCP clients should not bind a socket to a + /// specific address. + /// + /// If reuseAddress is true, sets the SO_REUSEADDR + /// socket option. + + void bind(const SocketAddress& address, bool reuseAddress, bool reusePort); /// Bind a local address to the socket. /// /// This is usually only done when establishing a server @@ -90,7 +100,44 @@ public: /// /// If reusePort is true, sets the SO_REUSEPORT /// socket option. - + + void bind6(const SocketAddress& address, bool reuseAddress = false, bool ipV6Only = false); + /// Bind a local IPv6 address to the socket. + /// + /// This is usually only done when establishing a server + /// socket. TCP clients should not bind a socket to a + /// specific address. + /// + /// If reuseAddress is true, sets the SO_REUSEADDR + /// socket option. + /// + /// The given address must be an IPv6 address. The + /// IPPROTO_IPV6/IPV6_V6ONLY option is set on the socket + /// according to the ipV6Only parameter. + /// + /// If the library has not been built with IPv6 support, + /// a Poco::NotImplementedException will be thrown. + + void bind6(const SocketAddress& address, bool reuseAddress, bool reusePort, bool ipV6Only); + /// Bind a local IPv6 address to the socket. + /// + /// This is usually only done when establishing a server + /// socket. TCP clients should not bind a socket to a + /// specific address. + /// + /// If reuseAddress is true, sets the SO_REUSEADDR + /// socket option. + /// + /// If reusePort is true, sets the SO_REUSEPORT + /// socket option. + /// + /// The given address must be an IPv6 address. The + /// IPPROTO_IPV6/IPV6_V6ONLY option is set on the socket + /// according to the ipV6Only parameter. + /// + /// If the library has not been built with IPv6 support, + /// a Poco::NotImplementedException will be thrown. + void listen(int backlog = 64); /// Puts the socket into listening state. /// @@ -108,42 +155,42 @@ public: void close(); /// Close the socket. - + void abort(); /// Aborts the connection by closing the /// underlying TCP connection. No orderly SSL shutdown /// is performed. - + int sendBytes(const void* buffer, int length, int flags = 0); /// Sends the contents of the given buffer through /// the socket. Any specified flags are ignored. /// /// Returns the number of bytes sent, which may be /// less than the number of bytes specified. - + int receiveBytes(void* buffer, int length, int flags = 0); /// Receives data from the socket and stores it /// in buffer. Up to length bytes are received. /// /// Returns the number of bytes received. - + int available() const; /// Returns the number of bytes available from the /// SSL buffer for immediate reading. - + int completeHandshake(); /// Completes the SSL handshake. /// /// If the SSL connection was the result of an accept(), /// the server-side handshake is completed, otherwise - /// a client-side handshake is performed. - + /// a client-side handshake is performed. + poco_socket_t sockfd(); /// Returns the underlying socket descriptor. X509* peerCertificate() const; /// Returns the peer's certificate. - + Context::Ptr context() const; /// Returns the SSL context used for this socket. @@ -158,17 +205,17 @@ public: void setPeerHostName(const std::string& hostName); /// Sets the peer host name for certificate validation purposes. - + const std::string& getPeerHostName() const; /// Returns the peer host name. - + Session::Ptr currentSession(); /// Returns the SSL session of the current connection, /// for reuse in a future connection (if session caching /// is enabled). /// /// If no connection is established, returns null. - + void useSession(Session::Ptr pSession); /// Sets the SSL session to use for the next /// connection. Setting a previously saved Session @@ -178,31 +225,31 @@ public: /// can be given. /// /// Must be called before connect() to be effective. - + bool sessionWasReused(); /// Returns true iff a reused session was negotiated during /// the handshake. - + protected: void acceptSSL(); /// Performs a server-side SSL handshake and certificate verification. void connectSSL(bool performHandshake); - /// Performs a client-side SSL handshake and establishes a secure + /// Performs a client-side SSL handshake and establishes a secure /// connection over an already existing TCP connection. - + long verifyPeerCertificateImpl(const std::string& hostName); /// Performs post-connect (or post-accept) peer certificate validation. - + static bool isLocalHost(const std::string& hostName); - /// Returns true iff the given host name is the local host + /// Returns true iff the given host name is the local host /// (either "localhost" or "127.0.0.1"). bool mustRetry(int rc); /// Returns true if the last operation should be retried, /// otherwise false. /// - /// In case of an SSL_ERROR_WANT_READ error, and if the socket is + /// In case of an SSL_ERROR_WANT_READ error, and if the socket is /// blocking, waits for the underlying socket to become readable. /// /// In case of an SSL_ERROR_WANT_WRITE error, and if the socket is @@ -216,7 +263,7 @@ protected: /// Handles an SSL error by throwing an appropriate exception. void reset(); - /// Prepares the socket for re-use. + /// Prepares the socket for re-use. /// /// After closing and resetting a socket, the socket can /// be used for a new connection. @@ -224,7 +271,7 @@ protected: /// Note that simply closing a socket is not sufficient /// to be able to re-use it again. -private: +private: SecureSocketImpl(const SecureSocketImpl&); SecureSocketImpl& operator = (const SecureSocketImpl&); @@ -234,7 +281,7 @@ private: bool _needHandshake; std::string _peerHostName; Session::Ptr _pSession; - + friend class SecureStreamSocketImpl; }; diff --git a/NetSSL_OpenSSL/src/SecureServerSocketImpl.cpp b/NetSSL_OpenSSL/src/SecureServerSocketImpl.cpp index 1e7d4bf23..64c8182cf 100644 --- a/NetSSL_OpenSSL/src/SecureServerSocketImpl.cpp +++ b/NetSSL_OpenSSL/src/SecureServerSocketImpl.cpp @@ -54,13 +54,20 @@ void SecureServerSocketImpl::connect(const SocketAddress& address, const Poco::T { throw Poco::InvalidAccessException("Cannot connect() a SecureServerSocket"); } - + void SecureServerSocketImpl::connectNB(const SocketAddress& address) { throw Poco::InvalidAccessException("Cannot connect() a SecureServerSocket"); } - + + +void SecureServerSocketImpl::bind(const SocketAddress& address, bool reuseAddress) +{ + _impl.bind(address, reuseAddress); + reset(_impl.sockfd()); +} + void SecureServerSocketImpl::bind(const SocketAddress& address, bool reuseAddress, bool reusePort) { @@ -68,20 +75,34 @@ void SecureServerSocketImpl::bind(const SocketAddress& address, bool reuseAddres reset(_impl.sockfd()); } - + +void SecureServerSocketImpl::bind6(const SocketAddress& address, bool reuseAddress, bool ipV6Only) +{ + _impl.bind6(address, reuseAddress, ipV6Only); + reset(_impl.sockfd()); +} + + +void SecureServerSocketImpl::bind6(const SocketAddress& address, bool reuseAddress, bool reusePort, bool ipV6Only) +{ + _impl.bind6(address, reuseAddress, reusePort, ipV6Only); + reset(_impl.sockfd()); +} + + void SecureServerSocketImpl::listen(int backlog) { _impl.listen(backlog); reset(_impl.sockfd()); } - + void SecureServerSocketImpl::close() { reset(); _impl.close(); } - + int SecureServerSocketImpl::sendBytes(const void* buffer, int length, int flags) { diff --git a/NetSSL_OpenSSL/src/SecureSocketImpl.cpp b/NetSSL_OpenSSL/src/SecureSocketImpl.cpp index 6dfc40727..d079842cf 100644 --- a/NetSSL_OpenSSL/src/SecureSocketImpl.cpp +++ b/NetSSL_OpenSSL/src/SecureSocketImpl.cpp @@ -192,6 +192,14 @@ void SecureSocketImpl::connectSSL(bool performHandshake) } +void SecureSocketImpl::bind(const SocketAddress& address, bool reuseAddress) +{ + poco_check_ptr (_pSocket); + + _pSocket->bind(address, reuseAddress); +} + + void SecureSocketImpl::bind(const SocketAddress& address, bool reuseAddress, bool reusePort) { poco_check_ptr (_pSocket); @@ -200,6 +208,22 @@ void SecureSocketImpl::bind(const SocketAddress& address, bool reuseAddress, boo } +void SecureSocketImpl::bind6(const SocketAddress& address, bool reuseAddress, bool ipV6Only) +{ + poco_check_ptr (_pSocket); + + _pSocket->bind6(address, reuseAddress, ipV6Only); +} + + +void SecureSocketImpl::bind6(const SocketAddress& address, bool reuseAddress, bool reusePort, bool ipV6Only) +{ + poco_check_ptr (_pSocket); + + _pSocket->bind6(address, reuseAddress, reusePort, ipV6Only); +} + + void SecureSocketImpl::listen(int backlog) { poco_check_ptr (_pSocket); diff --git a/NetSSL_Win/include/Poco/Net/SecureServerSocketImpl.h b/NetSSL_Win/include/Poco/Net/SecureServerSocketImpl.h index 749942840..32555fa45 100644 --- a/NetSSL_Win/include/Poco/Net/SecureServerSocketImpl.h +++ b/NetSSL_Win/include/Poco/Net/SecureServerSocketImpl.h @@ -47,7 +47,7 @@ public: /// with the client. /// /// The client socket's address is returned in clientAddr. - + void connect(const SocketAddress& address); /// Not supported by this kind of socket. /// @@ -62,7 +62,7 @@ public: /// Not supported by this kind of socket. /// /// Throws a Poco::InvalidAccessException. - + void bind(const SocketAddress& address, bool reuseAddress = false); /// Bind a local address to the socket. /// @@ -72,7 +72,57 @@ public: /// /// If reuseAddress is true, sets the SO_REUSEADDR /// socket option. - + + void bind(const SocketAddress& address, bool reuseAddress, bool reusePort); + /// Bind a local address to the socket. + /// + /// This is usually only done when establishing a server + /// socket. TCP clients should not bind a socket to a + /// specific address. + /// + /// If reuseAddress is true, sets the SO_REUSEADDR + /// socket option. + /// + /// If reusePort is true, sets the SO_REUSEPORT + /// socket option. + + void bind6(const SocketAddress& address, bool reuseAddress = false, bool ipV6Only = false); + /// Bind a local IPv6 address to the socket. + /// + /// This is usually only done when establishing a server + /// socket. TCP clients should not bind a socket to a + /// specific address. + /// + /// If reuseAddress is true, sets the SO_REUSEADDR + /// socket option. + /// + /// The given address must be an IPv6 address. The + /// IPPROTO_IPV6/IPV6_V6ONLY option is set on the socket + /// according to the ipV6Only parameter. + /// + /// If the library has not been built with IPv6 support, + /// a Poco::NotImplementedException will be thrown. + + void bind6(const SocketAddress& address, bool reuseAddress, bool reusePort, bool ipV6Only); + /// Bind a local IPv6 address to the socket. + /// + /// This is usually only done when establishing a server + /// socket. TCP clients should not bind a socket to a + /// specific address. + /// + /// If reuseAddress is true, sets the SO_REUSEADDR + /// socket option. + /// + /// If reusePort is true, sets the SO_REUSEPORT + /// socket option. + /// + /// The given address must be an IPv6 address. The + /// IPPROTO_IPV6/IPV6_V6ONLY option is set on the socket + /// according to the ipV6Only parameter. + /// + /// If the library has not been built with IPv6 support, + /// a Poco::NotImplementedException will be thrown. + void listen(int backlog = 64); /// Puts the socket into listening state. /// @@ -85,27 +135,27 @@ public: void close(); /// Close the socket. - + int sendBytes(const void* buffer, int length, int flags = 0); /// Not supported by this kind of socket. /// /// Throws a Poco::InvalidAccessException. - + int receiveBytes(void* buffer, int length, int flags = 0); /// Not supported by this kind of socket. /// /// Throws a Poco::InvalidAccessException. - + int sendTo(const void* buffer, int length, const SocketAddress& address, int flags = 0); /// Not supported by this kind of socket. /// /// Throws a Poco::InvalidAccessException. - + int receiveFrom(void* buffer, int length, SocketAddress& address, int flags = 0); /// Not supported by this kind of socket. /// /// Throws a Poco::InvalidAccessException. - + void sendUrgent(unsigned char data); /// Not supported by this kind of socket. /// @@ -114,7 +164,7 @@ public: bool secure() const; /// Returns true iff the socket's connection is secure /// (using SSL or TLS). - + Context::Ptr context() const; /// Returns the SSL context used by this socket. diff --git a/NetSSL_Win/include/Poco/Net/SecureSocketImpl.h b/NetSSL_Win/include/Poco/Net/SecureSocketImpl.h index 6e644a64b..0d08b2d3a 100644 --- a/NetSSL_Win/include/Poco/Net/SecureSocketImpl.h +++ b/NetSSL_Win/include/Poco/Net/SecureSocketImpl.h @@ -66,9 +66,9 @@ public: /// with the client. /// /// The client socket's address is returned in clientAddr. - + void connect(const SocketAddress& address, bool performHandshake); - /// Initializes the socket and establishes a connection to + /// Initializes the socket and establishes a connection to /// the TCP server at the given address. /// /// Can also be used for UDP sockets. In this case, no @@ -76,14 +76,14 @@ public: /// packets are restricted to the specified address. void connect(const SocketAddress& address, const Poco::Timespan& timeout, bool performHandshake); - /// Initializes the socket, sets the socket timeout and + /// Initializes the socket, sets the socket timeout and /// establishes a connection to the TCP server at the given address. void connectNB(const SocketAddress& address); - /// Initializes the socket and establishes a connection to + /// Initializes the socket and establishes a connection to /// the TCP server at the given address. Prior to opening the /// connection the socket is set to nonblocking mode. - + void bind(const SocketAddress& address, bool reuseAddress = false); /// Bind a local address to the socket. /// @@ -93,7 +93,57 @@ public: /// /// If reuseAddress is true, sets the SO_REUSEADDR /// socket option. - + + void bind(const SocketAddress& address, bool reuseAddress, bool reusePort); + /// Bind a local address to the socket. + /// + /// This is usually only done when establishing a server + /// socket. SSL clients should not bind a socket to a + /// specific address. + /// + /// If reuseAddress is true, sets the SO_REUSEADDR + /// socket option. + /// + /// If reusePort is true, sets the SO_REUSEPORT + /// socket option. + + void bind6(const SocketAddress& address, bool reuseAddress = false, bool ipV6Only = false); + /// Bind a local IPv6 address to the socket. + /// + /// This is usually only done when establishing a server + /// socket. TCP clients should not bind a socket to a + /// specific address. + /// + /// If reuseAddress is true, sets the SO_REUSEADDR + /// socket option. + /// + /// The given address must be an IPv6 address. The + /// IPPROTO_IPV6/IPV6_V6ONLY option is set on the socket + /// according to the ipV6Only parameter. + /// + /// If the library has not been built with IPv6 support, + /// a Poco::NotImplementedException will be thrown. + + void bind6(const SocketAddress& address, bool reuseAddress, bool reusePort, bool ipV6Only); + /// Bind a local IPv6 address to the socket. + /// + /// This is usually only done when establishing a server + /// socket. TCP clients should not bind a socket to a + /// specific address. + /// + /// If reuseAddress is true, sets the SO_REUSEADDR + /// socket option. + /// + /// If reusePort is true, sets the SO_REUSEPORT + /// socket option. + /// + /// The given address must be an IPv6 address. The + /// IPPROTO_IPV6/IPV6_V6ONLY option is set on the socket + /// according to the ipV6Only parameter. + /// + /// If the library has not been built with IPv6 support, + /// a Poco::NotImplementedException will be thrown. + void listen(int backlog = 64); /// Puts the socket into listening state. /// @@ -116,14 +166,14 @@ public: /// Aborts the connection by closing the /// underlying TCP connection. No orderly SSL shutdown /// is performed. - + int sendBytes(const void* buffer, int length, int flags = 0); /// Sends the contents of the given buffer through /// the socket. Any specified flags are ignored. /// /// Returns the number of bytes sent, which may be /// less than the number of bytes specified. - + int receiveBytes(void* buffer, int length, int flags = 0); /// Receives data from the socket and stores it /// in buffer. Up to length bytes are received. @@ -132,7 +182,7 @@ public: void setPeerHostName(const std::string& hostName); /// Sets the peer host name for certificate validation purposes. - + const std::string& getPeerHostName() const; /// Returns the peer host name. @@ -302,7 +352,7 @@ inline PCCERT_CONTEXT SecureSocketImpl::peerCertificate() const } -inline int SecureSocketImpl::lastError() +inline int SecureSocketImpl::lastError() { return SocketImpl::lastError(); } diff --git a/NetSSL_Win/src/SecureServerSocketImpl.cpp b/NetSSL_Win/src/SecureServerSocketImpl.cpp index c75da6e47..d7e311658 100644 --- a/NetSSL_Win/src/SecureServerSocketImpl.cpp +++ b/NetSSL_Win/src/SecureServerSocketImpl.cpp @@ -47,13 +47,13 @@ void SecureServerSocketImpl::connect(const SocketAddress& address, const Poco::T { throw Poco::InvalidAccessException("Cannot connect() a SecureServerSocket"); } - + void SecureServerSocketImpl::connectNB(const SocketAddress& address) { throw Poco::InvalidAccessException("Cannot connect() a SecureServerSocket"); } - + void SecureServerSocketImpl::bind(const SocketAddress& address, bool reuseAddress) { @@ -61,20 +61,41 @@ void SecureServerSocketImpl::bind(const SocketAddress& address, bool reuseAddres reset(_impl.sockfd()); } - + +void SecureServerSocketImpl::bind(const SocketAddress& address, bool reuseAddress, bool reusePort) +{ + _impl.bind(address, reuseAddress, reusePort); + reset(_impl.sockfd()); +} + + +void SecureServerSocketImpl::bind6(const SocketAddress& address, bool reuseAddress, bool ipV6Only) +{ + _impl.bind6(address, reuseAddress, ipV6Only); + reset(_impl.sockfd()); +} + + +void SecureServerSocketImpl::bind6(const SocketAddress& address, bool reuseAddress, bool reusePort, bool ipV6Only) +{ + _impl.bind6(address, reuseAddress, reusePort, ipV6Only); + reset(_impl.sockfd()); +} + + void SecureServerSocketImpl::listen(int backlog) { _impl.listen(backlog); reset(_impl.sockfd()); } - + void SecureServerSocketImpl::close() { reset(); _impl.close(); } - + int SecureServerSocketImpl::sendBytes(const void* buffer, int length, int flags) { diff --git a/NetSSL_Win/src/SecureSocketImpl.cpp b/NetSSL_Win/src/SecureSocketImpl.cpp index 8bcaa7516..c6ce9a839 100644 --- a/NetSSL_Win/src/SecureSocketImpl.cpp +++ b/NetSSL_Win/src/SecureSocketImpl.cpp @@ -212,10 +212,36 @@ void SecureSocketImpl::connectNB(const SocketAddress& address) void SecureSocketImpl::bind(const SocketAddress& address, bool reuseAddress) { + poco_check_ptr (_pSocket); + _pSocket->bind(address, reuseAddress); } +void SecureSocketImpl::bind(const SocketAddress& address, bool reuseAddress, bool reusePort) +{ + poco_check_ptr (_pSocket); + + _pSocket->bind(address, reuseAddress, reusePort); +} + + +void SecureSocketImpl::bind6(const SocketAddress& address, bool reuseAddress, bool ipV6Only) +{ + poco_check_ptr (_pSocket); + + _pSocket->bind6(address, reuseAddress, ipV6Only); +} + + +void SecureSocketImpl::bind6(const SocketAddress& address, bool reuseAddress, bool reusePort, bool ipV6Only) +{ + poco_check_ptr (_pSocket); + + _pSocket->bind6(address, reuseAddress, reusePort, ipV6Only); +} + + void SecureSocketImpl::listen(int backlog) { _mode = MODE_SERVER;