mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-13 22:50:17 +02:00
Backport #2257 to Poco 1.9.1
This commit is contained in:
@@ -63,7 +63,7 @@ public:
|
|||||||
///
|
///
|
||||||
/// Throws a Poco::InvalidAccessException.
|
/// Throws a Poco::InvalidAccessException.
|
||||||
|
|
||||||
void bind(const SocketAddress& address, bool reuseAddress = false);
|
void bind(const SocketAddress& address, bool reuseAddress = false, bool reusePort = false);
|
||||||
/// Bind a local address to the socket.
|
/// Bind a local address to the socket.
|
||||||
///
|
///
|
||||||
/// This is usually only done when establishing a server
|
/// This is usually only done when establishing a server
|
||||||
@@ -72,6 +72,10 @@ public:
|
|||||||
///
|
///
|
||||||
/// If reuseAddress is true, sets the SO_REUSEADDR
|
/// If reuseAddress is true, sets the SO_REUSEADDR
|
||||||
/// socket option.
|
/// socket option.
|
||||||
|
///
|
||||||
|
/// If reusePort is true, sets the SO_REUSEPORT
|
||||||
|
/// socket option.
|
||||||
|
|
||||||
|
|
||||||
void listen(int backlog = 64);
|
void listen(int backlog = 64);
|
||||||
/// Puts the socket into listening state.
|
/// Puts the socket into listening state.
|
||||||
|
@@ -78,7 +78,7 @@ public:
|
|||||||
/// the TCP server at the given address. Prior to opening the
|
/// the TCP server at the given address. Prior to opening the
|
||||||
/// connection the socket is set to nonblocking mode.
|
/// connection the socket is set to nonblocking mode.
|
||||||
|
|
||||||
void bind(const SocketAddress& address, bool reuseAddress = false);
|
void bind(const SocketAddress& address, bool reuseAddress = false, bool reusePort = false);
|
||||||
/// Bind a local address to the socket.
|
/// Bind a local address to the socket.
|
||||||
///
|
///
|
||||||
/// This is usually only done when establishing a server
|
/// This is usually only done when establishing a server
|
||||||
@@ -87,6 +87,9 @@ public:
|
|||||||
///
|
///
|
||||||
/// If reuseAddress is true, sets the SO_REUSEADDR
|
/// If reuseAddress is true, sets the SO_REUSEADDR
|
||||||
/// socket option.
|
/// socket option.
|
||||||
|
///
|
||||||
|
/// If reusePort is true, sets the SO_REUSEPORT
|
||||||
|
/// socket option.
|
||||||
|
|
||||||
void listen(int backlog = 64);
|
void listen(int backlog = 64);
|
||||||
/// Puts the socket into listening state.
|
/// Puts the socket into listening state.
|
||||||
|
@@ -62,9 +62,9 @@ void SecureServerSocketImpl::connectNB(const SocketAddress& address)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SecureServerSocketImpl::bind(const SocketAddress& address, bool reuseAddress)
|
void SecureServerSocketImpl::bind(const SocketAddress& address, bool reuseAddress, bool reusePort)
|
||||||
{
|
{
|
||||||
_impl.bind(address, reuseAddress);
|
_impl.bind(address, reuseAddress, reusePort);
|
||||||
reset(_impl.sockfd());
|
reset(_impl.sockfd());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -192,11 +192,11 @@ void SecureSocketImpl::connectSSL(bool performHandshake)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SecureSocketImpl::bind(const SocketAddress& address, bool reuseAddress)
|
void SecureSocketImpl::bind(const SocketAddress& address, bool reuseAddress, bool reusePort)
|
||||||
{
|
{
|
||||||
poco_check_ptr (_pSocket);
|
poco_check_ptr (_pSocket);
|
||||||
|
|
||||||
_pSocket->bind(address, reuseAddress);
|
_pSocket->bind(address, reuseAddress, reusePort);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user