29 global::Interop.Winsock.EnsureInitialized();
55 global::Interop.Winsock.EnsureInitialized();
70 if (!global::Interop.Kernel32.SetHandleInformation(
socket, global::Interop.Kernel32.HandleFlags.HANDLE_FLAG_INHERIT, global::Interop.Kernel32.HandleFlags.None))
84 global::Interop.Winsock.WSAPROTOCOL_INFOW*
ptr2 = (global::Interop.Winsock.WSAPROTOCOL_INFOW*)
ptr;
187 bool flag =
count <= 16;
206 for (
int i = 0; i <
count; i++)
298 bool flag =
count <= 16;
317 for (
int i = 0; i <
count; i++)
378 if (controlBuffer->length == (
UIntPtr)(ulong)
sizeof(global::Interop.Winsock.ControlData))
399 fixed (
byte*
ptr = socketAddress.Buffer)
403 wSAMsg.addressLength = (uint)socketAddress.Size;
406 wSABuffer.Length =
buffer.Length;
414 wSAMsg.controlBuffer.Length =
sizeof(global::Interop.Winsock.ControlData);
425 wSAMsg.controlBuffer.Length =
sizeof(global::Interop.Winsock.ControlDataIPv6);
435 wSAMsg.controlBuffer.Length = 0;
529 global::Interop.Winsock.IPMulticastRequest
mreq =
default(global::Interop.Winsock.IPMulticastRequest);
530 mreq.MulticastAddress = (int)
optionValue.Group.Address;
533 mreq.InterfaceAddress = (int)
optionValue.LocalAddress.Address;
550 global::Interop.Winsock.IPv6MulticastRequest
mreq =
default(global::Interop.Winsock.IPv6MulticastRequest);
551 mreq.MulticastAddress =
optionValue.Group.GetAddressBytes();
552 mreq.InterfaceIndex = (int)
optionValue.InterfaceIndex;
563 global::Interop.Winsock.Linger
linger =
default(global::Interop.Winsock.Linger);
564 linger.OnOff = (ushort)(
optionValue.Enabled ? 1 : 0);
629 global::Interop.Winsock.IPMulticastRequest
optionValue2 =
default(global::Interop.Winsock.IPMulticastRequest);
630 int optionLength = global::Interop.Winsock.IPMulticastRequest.Size;
645 global::Interop.Winsock.IPv6MulticastRequest
optionValue2 =
default(global::Interop.Winsock.IPv6MulticastRequest);
646 int optionLength = global::Interop.Winsock.IPv6MulticastRequest.Size;
659 global::Interop.Winsock.Linger
optionValue2 =
default(global::Interop.Winsock.Linger);
683 global::Interop.Winsock.TimeValue
socketTime =
default(global::Interop.Winsock.TimeValue);
706 handle.DangerousRelease();
738 global::Interop.Winsock.TimeValue
socketTime =
default(global::Interop.Winsock.TimeValue);
812 global::Interop.Mswsock.TransmitFileBuffers
transmitFileBuffers =
default(global::Interop.Mswsock.TransmitFileBuffers);
829 if (fileHandle !=
null)
863 ProtocolInformation =
new byte[
sizeof(global::Interop.Winsock.WSAPROTOCOL_INFOW)]
867 global::Interop.Winsock.WSAPROTOCOL_INFOW*
lpProtocolInfo = (global::Interop.Winsock.WSAPROTOCOL_INFOW*)
ptr;
static readonly IPAddress IPv6None
static readonly IPAddress None
static long HostToNetworkOrder(long host)
static readonly System.Net.NetEventSource Log
static void Info(object thisOrContextObject, FormattableString formattableString=null, [CallerMemberName] string memberName=null)
static void Error(object thisOrContextObject, FormattableString formattableString, [CallerMemberName] string memberName=null)
static void ValidateSegment(ArraySegment< byte > segment)
static SocketError Set(SafeSocketHandle handle, SocketOptionName optionName, byte[] optionValueSeconds)
static SocketError Get(SafeSocketHandle handle, SocketOptionName optionName, byte[] optionValueSeconds, ref int optionLength)
static unsafe bool TransmitFileHelper(SafeHandle socket, SafeHandle fileHandle, NativeOverlapped *overlapped, IntPtr pinnedPreBuffer, int preBufferLength, IntPtr pinnedPostBuffer, int postBufferLength, TransmitFileOptions flags)
static unsafe SocketError Receive(SafeSocketHandle handle, IList< ArraySegment< byte > > buffers, SocketFlags socketFlags, out int bytesTransferred)
static unsafe SocketError GetPeerName(SafeSocketHandle handle, Span< byte > buffer, ref int nameLen)
static unsafe SocketError Send(SafeSocketHandle handle, ReadOnlySpan< byte > buffer, SocketFlags socketFlags, out int bytesTransferred)
static SocketError CreateSocket(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType, out SafeSocketHandle socket)
static unsafe SocketError Select(IList checkRead, IList checkWrite, IList checkError, int microseconds)
static SocketError Connect(SafeSocketHandle handle, byte[] peerAddress, int peerAddressLen)
static SocketError GetLingerOption(SafeSocketHandle handle, out LingerOption optionValue)
static SocketError WindowsIoctl(SafeSocketHandle handle, int ioControlCode, byte[] optionInValue, byte[] optionOutValue, out int optionLength)
static readonly int MaximumAddressSize
static unsafe SocketError GetSockOpt(SafeSocketHandle handle, SocketOptionLevel optionLevel, SocketOptionName optionName, out int optionValue)
static SocketError SetSockOpt(SafeSocketHandle handle, SocketOptionLevel optionLevel, SocketOptionName optionName, int optionValue)
static SocketError Accept(SafeSocketHandle listenSocket, byte[] socketAddress, ref int socketAddressSize, out SafeSocketHandle socket)
static SocketError Disconnect(Socket socket, SafeSocketHandle handle, bool reuseSocket)
static void MicrosecondsToTimeValue(long microseconds, ref global::Interop.Winsock.TimeValue socketTime)
static unsafe SocketError SendFile(SafeSocketHandle handle, SafeFileHandle fileHandle, ReadOnlySpan< byte > preBuffer, ReadOnlySpan< byte > postBuffer, TransmitFileOptions flags)
static SocketError ReceiveFrom(SafeSocketHandle handle, byte[] buffer, int offset, int size, SocketFlags socketFlags, byte[] socketAddress, ref int addressLength, out int bytesTransferred)
static void SetReceivingDualModeIPv4PacketInformation(Socket socket)
static unsafe IPPacketInformation GetIPPacketInformation(global::Interop.Winsock.ControlDataIPv6 *controlBuffer)
static SocketError SetMulticastOption(SafeSocketHandle handle, SocketOptionName optionName, MulticastOption optionValue)
static SocketError SendTo(SafeSocketHandle handle, byte[] buffer, int offset, int size, SocketFlags socketFlags, byte[] peerAddress, int peerAddressSize, out int bytesTransferred)
static void CheckDualModeReceiveSupport(Socket socket)
static unsafe SocketError SetRawSockOpt(SafeSocketHandle handle, int optionLevel, int optionName, ReadOnlySpan< byte > optionValue)
static unsafe SocketError Poll(SafeSocketHandle handle, int microseconds, SelectMode mode, out bool status)
static unsafe SocketError Receive(SafeSocketHandle handle, Span< byte > buffer, SocketFlags socketFlags, out int bytesTransferred)
static SocketError Send(SafeSocketHandle handle, byte[] buffer, int offset, int size, SocketFlags socketFlags, out int bytesTransferred)
static SocketError SetIPv6MulticastOption(SafeSocketHandle handle, SocketOptionName optionName, IPv6MulticastOption optionValue)
static unsafe SocketError GetSockOpt(SafeSocketHandle handle, SocketOptionLevel optionLevel, SocketOptionName optionName, byte[] optionValue, ref int optionLength)
static SocketError ReceiveMessageFrom(Socket socket, SafeSocketHandle handle, byte[] buffer, int offset, int size, ref SocketFlags socketFlags, System.Net.Internals.SocketAddress socketAddress, out System.Net.Internals.SocketAddress receiveAddress, out IPPacketInformation ipPacketInformation, out int bytesTransferred)
static SocketError Receive(SafeSocketHandle handle, byte[] buffer, int offset, int size, SocketFlags socketFlags, out int bytesTransferred)
static unsafe SocketError SendTo(SafeSocketHandle handle, ReadOnlySpan< byte > buffer, SocketFlags socketFlags, byte[] peerAddress, int peerAddressSize, out int bytesTransferred)
static SocketError Listen(SafeSocketHandle handle, int backlog)
static unsafe SocketError GetRawSockOpt(SafeSocketHandle handle, int optionLevel, int optionName, Span< byte > optionValue, ref int optionLength)
static unsafe SocketError CreateSocket(SocketInformation socketInformation, out SafeSocketHandle socket, ref AddressFamily addressFamily, ref SocketType socketType, ref ProtocolType protocolType)
static unsafe SocketError GetSockName(SafeSocketHandle handle, byte *buffer, int *nameLen)
static SocketError GetMulticastOption(SafeSocketHandle handle, SocketOptionName optionName, out MulticastOption optionValue)
static SocketError Bind(SafeSocketHandle handle, ProtocolType socketProtocolType, byte[] buffer, int nameLen)
static SocketError SetLingerOption(SafeSocketHandle handle, LingerOption optionValue)
static void SetIPProtectionLevel(Socket socket, SocketOptionLevel optionLevel, int protectionLevel)
static SocketError SetBlocking(SafeSocketHandle handle, bool shouldBlock, out bool willBlock)
static unsafe SocketError ReceiveFrom(SafeSocketHandle handle, Span< byte > buffer, SocketFlags socketFlags, byte[] socketAddress, ref int addressLength, out int bytesTransferred)
static SocketError GetLastSocketError()
static SocketError GetIPv6MulticastOption(SafeSocketHandle handle, SocketOptionName optionName, out IPv6MulticastOption optionValue)
static unsafe SocketError Send(SafeSocketHandle handle, IList< ArraySegment< byte > > buffers, SocketFlags socketFlags, out int bytesTransferred)
static unsafe IPPacketInformation GetIPPacketInformation(global::Interop.Winsock.ControlData *controlBuffer)
static unsafe SocketError DuplicateSocket(SafeSocketHandle handle, int targetProcessId, out SocketInformation socketInformation)
static SocketError Shutdown(SafeSocketHandle handle, bool isConnected, bool isDisconnected, SocketShutdown how)
static unsafe SocketError SetSockOpt(SafeSocketHandle handle, SocketOptionLevel optionLevel, SocketOptionName optionName, byte[] optionValue)
static unsafe SocketError ReceiveMessageFrom(Socket socket, SafeSocketHandle handle, Span< byte > buffer, ref SocketFlags socketFlags, System.Net.Internals.SocketAddress socketAddress, out System.Net.Internals.SocketAddress receiveAddress, out IPPacketInformation ipPacketInformation, out int bytesTransferred)
static SocketError GetAvailable(SafeSocketHandle handle, out int available)
static void GetIPProtocolInformation(AddressFamily addressFamily, System.Net.Internals.SocketAddress socketAddress, out bool isIPv4, out bool isIPv6)
static void SelectFileDescriptor(IList socketList, Span< IntPtr > fileDescriptorSet, ref int refsAdded)
static void SocketListToFileDescriptorSet(IList socketList, Span< IntPtr > fileDescriptorSet, ref int refsAdded)
static void SocketListDangerousReleaseRefs(IList socketList, ref int refsAdded)
static int MaxAddressSize
static int GetLastWin32Error()
static unsafe IntPtr UnsafeAddrOfPinnedArrayElement(Array arr, int index)
void DangerousAddRef(ref bool success)
IntPtr DangerousGetHandle()
static string net_sockets_invalid_socketinformation
static string net_sockets_useblocking
static readonly IntPtr Zero
static GCHandle Alloc(object? value)
static readonly UIntPtr Zero