mirror of
https://github.com/pocoproject/poco.git
synced 2025-02-20 22:31:23 +01:00
check if specified address fits specified address family
This commit is contained in:
parent
3eca77450c
commit
aac6aba66c
@ -257,15 +257,18 @@ void SocketAddress::init(const std::string& hostAddress, Poco::UInt16 portNumber
|
||||
}
|
||||
|
||||
|
||||
void SocketAddress::init(Family family, const std::string& address)
|
||||
void SocketAddress::init(Family fam, const std::string& address)
|
||||
{
|
||||
if (family == UNIX_LOCAL)
|
||||
#if defined(POCO_OS_FAMILY_UNIX)
|
||||
if (fam == UNIX_LOCAL)
|
||||
{
|
||||
newLocal(address);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
init(address);
|
||||
if (fam != family()) throw Poco::InvalidArgumentException("address does not fit family");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user