mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-29 20:59:45 +01:00
socket initialization and other fixes
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// StreamSocketImpl.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Net/src/StreamSocketImpl.cpp#8 $
|
||||
// $Id: //poco/Main/Net/src/StreamSocketImpl.cpp#9 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: Sockets
|
||||
@@ -46,6 +46,18 @@ StreamSocketImpl::StreamSocketImpl()
|
||||
}
|
||||
|
||||
|
||||
StreamSocketImpl::StreamSocketImpl(IPAddress::Family family)
|
||||
{
|
||||
if (family == IPAddress::IPv4)
|
||||
init(AF_INET);
|
||||
#if defined(POCO_HAVE_IPv6)
|
||||
else if (family == IPAddress::IPv6)
|
||||
init(AF_INET6);
|
||||
#endif
|
||||
else throw InvalidArgumentException("Invalid or unsupported address family passed to StreamSocketImpl");
|
||||
}
|
||||
|
||||
|
||||
StreamSocketImpl::StreamSocketImpl(poco_socket_t sockfd): SocketImpl(sockfd)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user