private Socket(SafeCloseSocket fd)
{
if (NetEventSource.IsEnabled) NetEventSource.Enter(this);
InitializeSockets();
// NOTE: if this ctor is re-publicized/protected, check
// that fd is valid socket handle.
// This should never happen.
if (fd == null || fd.IsInvalid)
{
throw new ArgumentException(SR.net_InvalidSocketHandle);
}
_handle = fd;
_addressFamily = Sockets.AddressFamily.Unknown;
_socketType = Sockets.SocketType.Unknown;
_protocolType = Sockets.ProtocolType.Unknown;
if (NetEventSource.IsEnabled) NetEventSource.Exit(this);
}
#endregion