mirror of
https://github.com/pocoproject/poco.git
synced 2025-01-21 02:00:33 +01:00
make port constructor explicit; no longer prefer IPv4 addresses over IPv6 addresses
This commit is contained in:
parent
547553278c
commit
6195c97a86
@ -61,7 +61,7 @@ public:
|
||||
SocketAddress(const IPAddress& hostAddress, Poco::UInt16 portNumber);
|
||||
/// Creates a SocketAddress from an IP address and given port number.
|
||||
|
||||
SocketAddress(Poco::UInt16 port);
|
||||
explicit SocketAddress(Poco::UInt16 port);
|
||||
/// Creates a SocketAddress with unspecified (wildcard) IP address
|
||||
/// and given port number.
|
||||
|
||||
|
@ -250,7 +250,7 @@ void SocketAddress::init(const std::string& hostAddress, Poco::UInt16 portNumber
|
||||
HostEntry::AddressList addresses = he.addresses();
|
||||
if (addresses.size() > 0)
|
||||
{
|
||||
#if defined(POCO_HAVE_IPv6)
|
||||
#if defined(POCO_HAVE_IPv6) && defined(POCO_SOCKETADDRESS_PREFER_IPv4)
|
||||
// if we get both IPv4 and IPv6 addresses, prefer IPv4
|
||||
std::stable_sort(addresses.begin(), addresses.end(), AFLT());
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user