mscorlib(4.0.0.0) API with additions
System.Net.Sockets Namespace Reference

Classes

struct  IPPacketInformation
 Presents the packet information from a call to M:System.Net.Sockets.Socket.ReceiveMessageFrom(System.Byte[],System.Int32,System.Int32,System.Net.Sockets.SocketFlags@,System.Net.EndPoint@,System.Net.Sockets.IPPacketInformation@) or M:System.Net.Sockets.Socket.EndReceiveMessageFrom(System.IAsyncResult,System.Net.Sockets.SocketFlags@,System.Net.EndPoint@,System.Net.Sockets.IPPacketInformation@). More...
 
class  IPv6MulticastOption
 Contains option values for joining an IPv6 multicast group. More...
 
class  LingerOption
 Specifies whether a T:System.Net.Sockets.Socket will remain connected after a call to the M:System.Net.Sockets.Socket.Close or M:System.Net.Sockets.TcpClient.Close methods and the length of time it will remain connected, if data remains to be sent. More...
 
class  MulticastOption
 Contains T:System.Net.IPAddress values used to join and drop multicast groups. More...
 
class  NetworkStream
 Provides the underlying stream of data for network access. More...
 
class  SendPacketsElement
 Represents an element in a T:System.Net.Sockets.SendPacketsElement array. More...
 
class  Socket
 Implements the Berkeley sockets interface. More...
 
class  SocketAsyncEventArgs
 Represents an asynchronous socket operation. More...
 
class  SocketException
 The exception that is thrown when a socket error occurs. More...
 
struct  SocketInformation
 Encapsulates the information that is necessary to duplicate a T:System.Net.Sockets.Socket. More...
 
struct  SocketReceiveFromResult
 The result of a M:System.Net.Sockets.SocketTaskExtensions.ReceiveFromAsync(System.Net.Sockets.Socket,System.ArraySegment<System.Byte>,System.Net.Sockets.SocketFlags,System.Net.EndPoint) operation. More...
 
struct  SocketReceiveMessageFromResult
 The result of a M:System.Net.Sockets.SocketTaskExtensions.ReceiveMessageFromAsync(System.Net.Sockets.Socket,System.ArraySegment<System.Byte>,System.Net.Sockets.SocketFlags,System.Net.EndPoint) operation. More...
 
class  SocketTaskExtensions
 This class contains extension methods to the T:System.Net.Sockets.Socket class. More...
 
class  TcpClient
 Provides client connections for TCP network services. More...
 
class  TcpListener
 Listens for connections from TCP network clients. More...
 
class  UdpClient
 Provides User Datagram Protocol (UDP) network services. More...
 
struct  UdpReceiveResult
 Presents UDP receive result information from a call to the M:System.Net.Sockets.UdpClient.ReceiveAsync method. More...
 

Enumerations

enum  AddressFamily {
  AddressFamily.Unknown = -1, AddressFamily.Unspecified = 0, AddressFamily.Unix = 1, AddressFamily.InterNetwork = 2,
  AddressFamily.ImpLink = 3, AddressFamily.Pup = 4, AddressFamily.Chaos = 5, AddressFamily.NS = 6,
  AddressFamily.Ipx = 6, AddressFamily.Iso = 7, AddressFamily.Osi = 7, AddressFamily.Ecma = 8,
  AddressFamily.DataKit = 9, AddressFamily.Ccitt = 10, AddressFamily.Sna = 11, AddressFamily.DecNet = 12,
  AddressFamily.DataLink = 13, AddressFamily.Lat = 14, AddressFamily.HyperChannel = 0xF, AddressFamily.AppleTalk = 0x10,
  AddressFamily.NetBios = 17, AddressFamily.VoiceView = 18, AddressFamily.FireFox = 19, AddressFamily.Banyan = 21,
  AddressFamily.Atm = 22, AddressFamily.InterNetworkV6 = 23, AddressFamily.Cluster = 24, AddressFamily.Ieee12844 = 25,
  AddressFamily.Irda = 26, AddressFamily.NetworkDesigners = 28, AddressFamily.Max = 29
}
 Specifies the addressing scheme that an instance of the T:System.Net.Sockets.Socket class can use. More...
 
enum  AsyncEventBits {
  FdNone = 0x0, FdRead = 0x1, FdWrite = 0x2, FdOob = 0x4,
  FdAccept = 0x8, FdConnect = 0x10, FdClose = 0x20, FdQos = 0x40,
  FdGroupQos = 0x80, FdRoutingInterfaceChange = 0x100, FdAddressListChange = 0x200, FdAllEvents = 0x3FF
}
 
enum  AsyncEventBitsPos {
  FdReadBit, FdWriteBit, FdOobBit, FdAcceptBit,
  FdConnectBit, FdCloseBit, FdQosBit, FdGroupQosBit,
  FdRoutingInterfaceChangeBit, FdAddressListChangeBit, FdMaxEvents
}
 
enum  IOControlCode : long {
  IOControlCode.AsyncIO = 2147772029L, IOControlCode.NonBlockingIO = 2147772030L, IOControlCode.DataToRead = 1074030207L, IOControlCode.OobDataRead = 1074033415L,
  IOControlCode.AssociateHandle = 2281701377L, IOControlCode.EnableCircularQueuing = 671088642L, IOControlCode.Flush = 671088644L, IOControlCode.GetBroadcastAddress = 1207959557L,
  IOControlCode.GetExtensionFunctionPointer = 3355443206L, IOControlCode.GetQos = 3355443207L, IOControlCode.GetGroupQos = 3355443208L, IOControlCode.MultipointLoopback = 2281701385L,
  IOControlCode.MulticastScope = 2281701386L, IOControlCode.SetQos = 2281701387L, IOControlCode.SetGroupQos = 2281701388L, IOControlCode.TranslateHandle = 3355443213L,
  IOControlCode.RoutingInterfaceQuery = 3355443220L, IOControlCode.RoutingInterfaceChange = 2281701397L, IOControlCode.AddressListQuery = 1207959574L, IOControlCode.AddressListChange = 671088663L,
  IOControlCode.QueryTargetPnpHandle = 1207959576L, IOControlCode.NamespaceChange = 2281701401L, IOControlCode.AddressListSort = 3355443225L, IOControlCode.ReceiveAll = 2550136833L,
  IOControlCode.ReceiveAllMulticast = 2550136834L, IOControlCode.ReceiveAllIgmpMulticast = 2550136835L, IOControlCode.KeepAliveValues = 2550136836L, IOControlCode.AbsorbRouterAlert = 2550136837L,
  IOControlCode.UnicastInterface = 2550136838L, IOControlCode.LimitBroadcasts = 2550136839L, IOControlCode.BindToInterface = 2550136840L, IOControlCode.MulticastInterface = 2550136841L,
  IOControlCode.AddMulticastGroupOnInterface = 2550136842L, IOControlCode.DeleteMulticastGroupFromInterface = 2550136843L
}
 Specifies the IO control codes supported by the M:System.Net.Sockets.Socket.IOControl(System.Int32,System.Byte[],System.Byte[]) method. More...
 
enum  IPProtectionLevel { IPProtectionLevel.Unspecified = -1, IPProtectionLevel.Unrestricted = 10, IPProtectionLevel.EdgeRestricted = 20, IPProtectionLevel.Restricted = 30 }
 A value that enables restriction of an IPv6 socket to a specified scope, such as addresses with the same link local or site local prefix. More...
 
enum  ProtocolFamily {
  ProtocolFamily.Unknown = -1, ProtocolFamily.Unspecified = 0, ProtocolFamily.Unix = 1, ProtocolFamily.InterNetwork = 2,
  ProtocolFamily.ImpLink = 3, ProtocolFamily.Pup = 4, ProtocolFamily.Chaos = 5, ProtocolFamily.NS = 6,
  ProtocolFamily.Ipx = 6, ProtocolFamily.Iso = 7, ProtocolFamily.Osi = 7, ProtocolFamily.Ecma = 8,
  ProtocolFamily.DataKit = 9, ProtocolFamily.Ccitt = 10, ProtocolFamily.Sna = 11, ProtocolFamily.DecNet = 12,
  ProtocolFamily.DataLink = 13, ProtocolFamily.Lat = 14, ProtocolFamily.HyperChannel = 0xF, ProtocolFamily.AppleTalk = 0x10,
  ProtocolFamily.NetBios = 17, ProtocolFamily.VoiceView = 18, ProtocolFamily.FireFox = 19, ProtocolFamily.Banyan = 21,
  ProtocolFamily.Atm = 22, ProtocolFamily.InterNetworkV6 = 23, ProtocolFamily.Cluster = 24, ProtocolFamily.Ieee12844 = 25,
  ProtocolFamily.Irda = 26, ProtocolFamily.NetworkDesigners = 28, ProtocolFamily.Max = 29
}
 Specifies the type of protocol that an instance of the T:System.Net.Sockets.Socket class can use. More...
 
enum  ProtocolType {
  ProtocolType.IP = 0, ProtocolType.IPv6HopByHopOptions = 0, ProtocolType.Icmp = 1, ProtocolType.Igmp = 2,
  ProtocolType.Ggp = 3, ProtocolType.IPv4 = 4, ProtocolType.Tcp = 6, ProtocolType.Pup = 12,
  ProtocolType.Udp = 17, ProtocolType.Idp = 22, ProtocolType.IPv6 = 41, ProtocolType.IPv6RoutingHeader = 43,
  ProtocolType.IPv6FragmentHeader = 44, ProtocolType.IPSecEncapsulatingSecurityPayload = 50, ProtocolType.IPSecAuthenticationHeader = 51, ProtocolType.IcmpV6 = 58,
  ProtocolType.IPv6NoNextHeader = 59, ProtocolType.IPv6DestinationOptions = 60, ProtocolType.ND = 77, ProtocolType.Raw = 0xFF,
  ProtocolType.Unspecified = 0, ProtocolType.Ipx = 1000, ProtocolType.Spx = 1256, ProtocolType.SpxII = 1257,
  ProtocolType.Unknown = -1
}
 Specifies the protocols that the T:System.Net.Sockets.Socket class supports. More...
 
enum  SelectMode { SelectMode.SelectRead, SelectMode.SelectWrite, SelectMode.SelectError }
 Defines the polling modes for the M:System.Net.Sockets.Socket.Poll(System.Int32,System.Net.Sockets.SelectMode) method. More...
 
enum  SocketAsyncOperation {
  SocketAsyncOperation.None, SocketAsyncOperation.Accept, SocketAsyncOperation.Connect, SocketAsyncOperation.Disconnect,
  SocketAsyncOperation.Receive, SocketAsyncOperation.ReceiveFrom, SocketAsyncOperation.ReceiveMessageFrom, SocketAsyncOperation.Send,
  SocketAsyncOperation.SendPackets, SocketAsyncOperation.SendTo
}
 The type of asynchronous socket operation most recently performed with this context object. More...
 
enum  SocketClientAccessPolicyProtocol { SocketClientAccessPolicyProtocol.Tcp, SocketClientAccessPolicyProtocol.Http }
 Specifies the method to download a client access policy file. More...
 
enum  SocketError {
  SocketError.Success = 0, SocketError.SocketError = -1, SocketError.Interrupted = 10004, SocketError.AccessDenied = 10013,
  SocketError.Fault = 10014, SocketError.InvalidArgument = 10022, SocketError.TooManyOpenSockets = 10024, SocketError.WouldBlock = 10035,
  SocketError.InProgress = 10036, SocketError.AlreadyInProgress = 10037, SocketError.NotSocket = 10038, SocketError.DestinationAddressRequired = 10039,
  SocketError.MessageSize = 10040, SocketError.ProtocolType = 10041, SocketError.ProtocolOption = 10042, SocketError.ProtocolNotSupported = 10043,
  SocketError.SocketNotSupported = 10044, SocketError.OperationNotSupported = 10045, SocketError.ProtocolFamilyNotSupported = 10046, SocketError.AddressFamilyNotSupported = 10047,
  SocketError.AddressAlreadyInUse = 10048, SocketError.AddressNotAvailable = 10049, SocketError.NetworkDown = 10050, SocketError.NetworkUnreachable = 10051,
  SocketError.NetworkReset = 10052, SocketError.ConnectionAborted = 10053, SocketError.ConnectionReset = 10054, SocketError.NoBufferSpaceAvailable = 10055,
  SocketError.IsConnected = 10056, SocketError.NotConnected = 10057, SocketError.Shutdown = 10058, SocketError.TimedOut = 10060,
  SocketError.ConnectionRefused = 10061, SocketError.HostDown = 10064, SocketError.HostUnreachable = 10065, SocketError.ProcessLimit = 10067,
  SocketError.SystemNotReady = 10091, SocketError.VersionNotSupported = 10092, SocketError.NotInitialized = 10093, SocketError.Disconnecting = 10101,
  SocketError.TypeNotFound = 10109, SocketError.HostNotFound = 11001, SocketError.TryAgain = 11002, SocketError.NoRecovery = 11003,
  SocketError.NoData = 11004, SocketError.IOPending = 997, SocketError.OperationAborted = 995
}
 Defines error codes for the T:System.Net.Sockets.Socket class. More...
 
enum  SocketFlags {
  SocketFlags.None = 0x0, SocketFlags.OutOfBand = 0x1, SocketFlags.Peek = 0x2, SocketFlags.DontRoute = 0x4,
  SocketFlags.MaxIOVectorLength = 0x10, SocketFlags.Truncated = 0x100, SocketFlags.ControlDataTruncated = 0x200, SocketFlags.Broadcast = 0x400,
  SocketFlags.Multicast = 0x800, SocketFlags.Partial = 0x8000
}
 Specifies socket send and receive behaviors. More...
 
enum  SocketInformationOptions { SocketInformationOptions.NonBlocking = 0x1, SocketInformationOptions.Connected = 0x2, SocketInformationOptions.Listening = 0x4, SocketInformationOptions.UseOnlyOverlappedIO = 0x8 }
 Describes states for a T:System.Net.Sockets.Socket. More...
 
enum  SocketOptionLevel {
  SocketOptionLevel.Socket = 0xFFFF, SocketOptionLevel.IP = 0, SocketOptionLevel.IPv6 = 41, SocketOptionLevel.Tcp = 6,
  SocketOptionLevel.Udp = 17
}
 Defines socket option levels for the M:System.Net.Sockets.Socket.SetSocketOption(System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,System.Int32) and M:System.Net.Sockets.Socket.GetSocketOption(System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName) methods. More...
 
enum  SocketOptionName {
  SocketOptionName.Debug = 1, SocketOptionName.AcceptConnection = 2, SocketOptionName.ReuseAddress = 4, SocketOptionName.KeepAlive = 8,
  SocketOptionName.DontRoute = 0x10, SocketOptionName.Broadcast = 0x20, SocketOptionName.UseLoopback = 0x40, SocketOptionName.Linger = 0x80,
  SocketOptionName.OutOfBandInline = 0x100, SocketOptionName.DontLinger = -129, SocketOptionName.ExclusiveAddressUse = -5, SocketOptionName.SendBuffer = 4097,
  SocketOptionName.ReceiveBuffer = 4098, SocketOptionName.SendLowWater = 4099, SocketOptionName.ReceiveLowWater = 4100, SocketOptionName.SendTimeout = 4101,
  SocketOptionName.ReceiveTimeout = 4102, SocketOptionName.Error = 4103, SocketOptionName.Type = 4104, SocketOptionName.ReuseUnicastPort = 12295,
  SocketOptionName.MaxConnections = int.MaxValue, SocketOptionName.IPOptions = 1, SocketOptionName.HeaderIncluded = 2, SocketOptionName.TypeOfService = 3,
  SocketOptionName.IpTimeToLive = 4, SocketOptionName.MulticastInterface = 9, SocketOptionName.MulticastTimeToLive = 10, SocketOptionName.MulticastLoopback = 11,
  SocketOptionName.AddMembership = 12, SocketOptionName.DropMembership = 13, SocketOptionName.DontFragment = 14, SocketOptionName.AddSourceMembership = 0xF,
  SocketOptionName.DropSourceMembership = 0x10, SocketOptionName.BlockSource = 17, SocketOptionName.UnblockSource = 18, SocketOptionName.PacketInformation = 19,
  SocketOptionName.HopLimit = 21, SocketOptionName.IPProtectionLevel = 23, SocketOptionName.IPv6Only = 27, SocketOptionName.NoDelay = 1,
  SocketOptionName.BsdUrgent = 2, SocketOptionName.Expedited = 2, SocketOptionName.NoChecksum = 1, SocketOptionName.ChecksumCoverage = 20,
  SocketOptionName.UpdateAcceptContext = 28683, SocketOptionName.UpdateConnectContext = 28688
}
 Defines configuration option names. More...
 
enum  SocketShutdown { SocketShutdown.Receive, SocketShutdown.Send, SocketShutdown.Both }
 Defines constants that are used by the M:System.Net.Sockets.Socket.Shutdown(System.Net.Sockets.SocketShutdown) method. More...
 
enum  SocketType {
  SocketType.Stream = 1, SocketType.Dgram = 2, SocketType.Raw = 3, SocketType.Rdm = 4,
  SocketType.Seqpacket = 5, SocketType.Unknown = -1
}
 Specifies the type of socket that an instance of the T:System.Net.Sockets.Socket class represents. More...
 
enum  TransmitFileOptions {
  TransmitFileOptions.UseDefaultWorkerThread = 0x0, TransmitFileOptions.Disconnect = 0x1, TransmitFileOptions.ReuseSocket = 0x2, TransmitFileOptions.WriteBehind = 0x4,
  TransmitFileOptions.UseSystemThread = 0x10, TransmitFileOptions.UseKernelApc = 0x20
}
 The T:System.Net.Sockets.TransmitFileOptions enumeration defines values used in file transfer requests. More...
 

Functions

internal delegate bool AcceptExDelegate (SafeCloseSocket listenSocketHandle, SafeCloseSocket acceptSocketHandle, IntPtr buffer, int len, int localAddressLength, int remoteAddressLength, out int bytesReceived, SafeHandle overlapped)
 
internal delegate bool ConnectExDelegate (SafeCloseSocket socketHandle, IntPtr socketAddress, int socketAddressSize, IntPtr buffer, int dataLength, out int bytesSent, SafeHandle overlapped)
 
internal delegate bool DisconnectExDelegate (SafeCloseSocket socketHandle, SafeHandle overlapped, int flags, int reserved)
 
internal delegate bool DisconnectExDelegate_Blocking (IntPtr socketHandle, IntPtr overlapped, int flags, int reserved)
 
internal delegate void GetAcceptExSockaddrsDelegate (IntPtr buffer, int receiveDataLength, int localAddressLength, int remoteAddressLength, out IntPtr localSocketAddress, out int localSocketAddressLength, out IntPtr remoteSocketAddress, out int remoteSocketAddressLength)
 
internal delegate bool TransmitPacketsDelegate (SafeCloseSocket socketHandle, IntPtr packetArray, int elementCount, int sendSize, SafeNativeOverlapped overlapped, TransmitFileOptions flags)
 
internal delegate SocketError WSARecvMsgDelegate (SafeCloseSocket socketHandle, IntPtr msg, out int bytesTransferred, SafeHandle overlapped, IntPtr completionRoutine)
 
internal delegate SocketError WSARecvMsgDelegate_Blocking (IntPtr socketHandle, IntPtr msg, out int bytesTransferred, IntPtr overlapped, IntPtr completionRoutine)
 

Enumeration Type Documentation

◆ AddressFamily

Specifies the addressing scheme that an instance of the T:System.Net.Sockets.Socket class can use.

Enumerator
Unknown 

Unknown address family.

Unspecified 

Unspecified address family.

Unix 

Unix local to host address.

InterNetwork 

Address for IP version 4.

ImpLink 

ARPANET IMP address.

Pup 

Address for PUP protocols.

Chaos 

Address for MIT CHAOS protocols.

NS 

Address for Xerox NS protocols.

Ipx 

IPX or SPX address.

Iso 

Address for ISO protocols.

Osi 

Address for OSI protocols.

Ecma 

European Computer Manufacturers Association (ECMA) address.

DataKit 

Address for Datakit protocols.

Ccitt 

Addresses for CCITT protocols, such as X.25.

Sna 

IBM SNA address.

DecNet 

DECnet address.

DataLink 

Direct data-link interface address.

Lat 

LAT address.

HyperChannel 

NSC Hyperchannel address.

AppleTalk 

AppleTalk address.

NetBios 

NetBios address.

VoiceView 

VoiceView address.

FireFox 

FireFox address.

Banyan 

Banyan address.

Atm 

Native ATM services address.

InterNetworkV6 

Address for IP version 6.

Cluster 

Address for Microsoft cluster products.

Ieee12844 

IEEE 1284.4 workgroup address.

Irda 

IrDA address.

NetworkDesigners 

Address for Network Designers OSI gateway-enabled protocols.

Max 

MAX address.

Definition at line 5 of file AddressFamily.cs.

◆ IOControlCode

Specifies the IO control codes supported by the M:System.Net.Sockets.Socket.IOControl(System.Int32,System.Byte[],System.Byte[]) method.

Enumerator
AsyncIO 

Enable notification for when data is waiting to be received. This value is equal to the Winsock 2 FIOASYNC constant.

NonBlockingIO 

Control the blocking behavior of the socket. If the argument specified with this control code is zero, the socket is placed in blocking mode. If the argument is nonzero, the socket is placed in nonblocking mode. This value is equal to the Winsock 2 FIONBIO constant.

DataToRead 

Return the number of bytes available for reading. This value is equal to the Winsock 2 FIONREAD constant.

OobDataRead 

Return information about out-of-band data waiting to be received. When using this control code on stream sockets, the return value indicates the number of bytes available.

AssociateHandle 

Associate this socket with the specified handle of a companion interface. Refer to the appropriate protocol-specific annex in the Winsock 2 reference or documentation for the particular companion interface for additional details. It is recommended that the Component Object Model (COM) be used instead of this IOCTL to discover and track other interfaces that might be supported by a socket. This control code is present for backward compatibility with systems where COM is not available or cannot be used for some other reason. This value is equal to the Winsock 2 SIO_ASSOCIATE_HANDLE constant.

EnableCircularQueuing 

Replace the oldest queued datagram with an incoming datagram when the incoming message queues are full. This value is equal to the Winsock 2 SIO_ENABLE_CIRCULAR_QUEUEING constant.

Flush 

Discard the contents of the sending queue. This value is equal to the Winsock 2 SIO_FLUSH constant.

GetBroadcastAddress 

Return a SOCKADDR structure that contains the broadcast address for the address family of the current socket. The returned address can be used with the Overload:System.Net.Sockets.Socket.SendTo method. This value is equal to the Winsock 2 SIO_GET_BROADCAST_ADDRESS constant. This value can be used on User Datagram Protocol (UDP) sockets only.

GetExtensionFunctionPointer 

Obtain provider-specific functions that are not part of the Winsock specification. Functions are specified using their provider-assigned GUID. This value is equal to the Winsock 2 SIO_GET_EXTENSION_FUNCTION_POINTER constant.

GetQos 

Retrieve the QOS structure associated with the socket. This control is only supported on platforms that provide a QOS capable transport (Windows Me, Windows 2000, and later.) This value is equal to the Winsock 2 SIO_GET_QOS constant.

GetGroupQos 

Return the Quality of Service (QOS) attributes for the socket group. This value is reserved for future use, and is equal to the Winsock 2 SIO_GET_GROUP_QOS constant.

MultipointLoopback 

Control whether multicast data sent by the socket appears as incoming data in the sockets receive queue. This value is equal to the Winsock 2 SIO_MULTIPOINT_LOOPBACK constant.

MulticastScope 

Control the number of times a multicast packet can be forwarded by a router, also known as the Time to Live (TTL), or hop count. This value is equal to the Winsock 2 SIO_MULTICAST_SCOPE constant.

SetQos 

Set the Quality of Service (QOS) attributes for the socket. QOS defines the bandwidth requirements for the socket. This control code is supported on Windows Me, Windows 2000, and later operating systems. This value is equal to the Winsock 2 SIO_SET_QOS constant.

SetGroupQos 

Set the Quality of Service (QOS) attributes for the socket group. This value is reserved for future use and is equal to the Winsock 2 SIO_SET_GROUP_QOS constant.

TranslateHandle 

Return a handle for the socket that is valid in the context of a companion interface. This value is equal to the Winsock 2 SIO_TRANSLATE_HANDLE constant.

RoutingInterfaceQuery 

Return the interface addresses that can be used to connect to the specified remote address. This value is equal to the Winsock 2 SIO_ROUTING_INTERFACE_QUERY constant.

RoutingInterfaceChange 

Enable receiving notification when the local interface used to access a remote endpoint changes. This value is equal to the Winsock 2 SIO_ROUTING_INTERFACE_CHANGE constant.

AddressListQuery 

Return the list of local interfaces that the socket can bind to. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_ADDRESS_LIST_QUERY constant.

AddressListChange 

Enable receiving notification when the list of local interfaces for the socket's protocol family changes. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_ADDRESS_LIST_CHANGE constant.

QueryTargetPnpHandle 

Retrieve the underlying provider's SOCKET handle. This handle can be used to receive plug-and-play event notification. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_QUERY_TARGET_PNP_HANDLE constant.

NamespaceChange 

Control whether the socket receives notification when a namespace query becomes invalid. This control code is supported on Windows XP and later operating systems. This value is equal to the Winsock 2 SIO_NSP_NOTIFY_CHANGE constant.

AddressListSort 

Sort the structure returned by the F:System.Net.Sockets.IOControlCode.AddressListQuery field and add scope ID information for IPv6 addresses. This control code is supported on Windows XP and later operating systems. This value is equal to the Winsock 2 SIO_ADDRESS_LIST_SORT constant.

ReceiveAll 

Enable receiving all IPv4 packets on the network. The socket must have address family F:System.Net.Sockets.AddressFamily.InterNetwork, the socket type must be F:System.Net.Sockets.SocketType.Raw, and the protocol type must be F:System.Net.Sockets.ProtocolType.IP. The current user must belong to the Administrators group on the local computer, and the socket must be bound to a specific port. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_RCVALL constant.

ReceiveAllMulticast 

Enable receiving all multicast IPv4 packets on the network. These are packets with destination addresses in the range 224.0.0.0 through 239.255.255.255. The socket must have address family F:System.Net.Sockets.AddressFamily.InterNetwork, the socket type must be F:System.Net.Sockets.SocketType.Raw, and the protocol type must be F:System.Net.Sockets.ProtocolType.Udp. The current user must belong to the Administrators group on the local computer, and the socket must be bound to a specific port. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_RCVALL_MCAST constant.

ReceiveAllIgmpMulticast 

Enable receiving all Internet Group Management Protocol (IGMP) packets on the network. The socket must have address family F:System.Net.Sockets.AddressFamily.InterNetwork, the socket type must be F:System.Net.Sockets.SocketType.Raw, and the protocol type must be F:System.Net.Sockets.ProtocolType.Igmp. The current user must belong to the Administrators group on the local computer, and the socket must be bound to a specific port. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_RCVALL_IGMPMCAST constant.

KeepAliveValues 

Control sending TCP keep-alive packets and the interval at which they are sent. This control code is supported on Windows 2000 and later operating systems. For additional information, see RFC 1122 section 4.2.3.6. This value is equal to the Winsock 2 SIO_KEEPALIVE_VALS constant.

AbsorbRouterAlert 

This value is equal to the Winsock 2 SIO_ABSORB_RTRALERT constant.

UnicastInterface 

Set the interface used for outgoing unicast packets. This value is equal to the Winsock 2 SIO_UCAST_IF constant.

LimitBroadcasts 

This value is equal to the Winsock 2 SIO_LIMIT_BROADCASTS constant.

BindToInterface 

Bind the socket to a specified interface index. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_INDEX_BIND constant.

MulticastInterface 

Set the interface used for outgoing multicast packets. The interface is identified by its index. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_INDEX_MCASTIF constant.

AddMulticastGroupOnInterface 

Join a multicast group using an interface identified by its index. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_INDEX_ADD_MCAST constant.

DeleteMulticastGroupFromInterface 

Remove the socket from a multicast group. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_INDEX_ADD_MCAST constant.

Definition at line 4 of file IOControlCode.cs.

◆ IPProtectionLevel

A value that enables restriction of an IPv6 socket to a specified scope, such as addresses with the same link local or site local prefix.

Enumerator
Unspecified 

The IP protection level is unspecified. On Windows 7 and Windows Server 2008 R2, the default value for the IP Protection level on a socket is unspecified.

Unrestricted 

The IP protection level is unrestricted. This value would be used by applications designed to operate across the Internet, including applications taking advantage of IPv6 NAT traversal capabilities built into Windows (Teredo, for example). These applications may bypass IPv4 firewalls, so applications must be hardened against Internet attacks directed at the opened port. On Windows Server 2008 R2 and Windows Vista, the default value for the IP Protection level on a socket is unrestricted.

EdgeRestricted 

The IP protection level is edge restricted. This value would be used by applications designed to operate across the Internet. This setting does not allow Network Address Translation (NAT) traversal using the Windows Teredo implementation. These applications may bypass IPv4 firewalls, so applications must be hardened against Internet attacks directed at the opened port. On Windows Server 2003 and Windows XP, the default value for the IP Protection level on a socket is edge restricted.

Restricted 

The IP protection level is restricted. This value would be used by intranet applications that do not implement Internet scenarios. These applications are generally not tested or hardened against Internet-style attacks. This setting will limit the received traffic to link-local only.

Definition at line 4 of file IPProtectionLevel.cs.

◆ ProtocolFamily

Specifies the type of protocol that an instance of the T:System.Net.Sockets.Socket class can use.

Enumerator
Unknown 

Unknown protocol.

Unspecified 

Unspecified protocol.

Unix 

Unix local to host protocol.

InterNetwork 

IP version 4 protocol.

ImpLink 

ARPANET IMP protocol.

Pup 

PUP protocol.

Chaos 

MIT CHAOS protocol.

NS 

Xerox NS protocol.

Ipx 

IPX or SPX protocol.

Iso 

ISO protocol.

Osi 

OSI protocol.

Ecma 

European Computer Manufacturers Association (ECMA) protocol.

DataKit 

DataKit protocol.

Ccitt 

CCITT protocol, such as X.25.

Sna 

IBM SNA protocol.

DecNet 

DECNet protocol.

DataLink 

Direct data link protocol.

Lat 

LAT protocol.

HyperChannel 

NSC HyperChannel protocol.

AppleTalk 

AppleTalk protocol.

NetBios 

NetBIOS protocol.

VoiceView 

VoiceView protocol.

FireFox 

FireFox protocol.

Banyan 

Banyan protocol.

Atm 

Native ATM services protocol.

InterNetworkV6 

IP version 6 protocol.

Cluster 

Microsoft Cluster products protocol.

Ieee12844 

IEEE 1284.4 workgroup protocol.

Irda 

IrDA protocol.

NetworkDesigners 

Network Designers OSI gateway enabled protocol.

Max 

MAX protocol.

Definition at line 4 of file ProtocolFamily.cs.

◆ ProtocolType

Specifies the protocols that the T:System.Net.Sockets.Socket class supports.

Enumerator
IP 

Internet Protocol.

IPv6HopByHopOptions 

IPv6 Hop by Hop Options header.

Icmp 

Internet Control Message Protocol.

Igmp 

Internet Group Management Protocol.

Ggp 

Gateway To Gateway Protocol.

IPv4 

Internet Protocol version 4.

Tcp 

Transmission Control Protocol.

Pup 

PARC Universal Packet Protocol.

Udp 

User Datagram Protocol.

Idp 

Internet Datagram Protocol.

IPv6 

Internet Protocol version 6 (IPv6).

IPv6RoutingHeader 

IPv6 Routing header.

IPv6FragmentHeader 

IPv6 Fragment header.

IPSecEncapsulatingSecurityPayload 

IPv6 Encapsulating Security Payload header.

IPSecAuthenticationHeader 

IPv6 Authentication header. For details, see RFC 2292 section 2.2.1, available at http://www.ietf.org.

IcmpV6 

Internet Control Message Protocol for IPv6.

IPv6NoNextHeader 

IPv6 No next header.

IPv6DestinationOptions 

IPv6 Destination Options header.

ND 

Net Disk Protocol (unofficial).

Raw 

Raw IP packet protocol.

Unspecified 

Unspecified protocol.

Ipx 

Internet Packet Exchange Protocol.

Spx 

Sequenced Packet Exchange protocol.

SpxII 

Sequenced Packet Exchange version 2 protocol.

Unknown 

Unknown protocol.

Definition at line 4 of file ProtocolType.cs.

◆ SelectMode

Defines the polling modes for the M:System.Net.Sockets.Socket.Poll(System.Int32,System.Net.Sockets.SelectMode) method.

Enumerator
SelectRead 

Read status mode.

SelectWrite 

Write status mode.

SelectError 

Error status mode.

Definition at line 4 of file SelectMode.cs.

◆ SocketAsyncOperation

The type of asynchronous socket operation most recently performed with this context object.

Enumerator
None 

None of the socket operations.

Accept 

A socket Accept operation.

Connect 

A socket Connect operation.

Disconnect 

A socket Disconnect operation.

Receive 

A socket Receive operation.

ReceiveFrom 

A socket ReceiveFrom operation.

ReceiveMessageFrom 

A socket ReceiveMessageFrom operation.

Send 

A socket Send operation.

SendPackets 

A socket SendPackets operation.

SendTo 

A socket SendTo operation.

Definition at line 4 of file SocketAsyncOperation.cs.

◆ SocketClientAccessPolicyProtocol

Specifies the method to download a client access policy file.

Enumerator
Tcp 

The socket policy file is downloaded using a custom TCP protocol running on TCP port 943.

Http 

The socket policy file is downloaded using the HTTP protocol running on TCP port 943.

Definition at line 8 of file SocketClientAccessPolicyProtocol.cs.

◆ SocketError

Defines error codes for the T:System.Net.Sockets.Socket class.

Enumerator
Success 

The T:System.Net.Sockets.Socket operation succeeded.

SocketError 

An unspecified T:System.Net.Sockets.Socket error has occurred.

Interrupted 

A blocking T:System.Net.Sockets.Socket call was canceled.

AccessDenied 

An attempt was made to access a T:System.Net.Sockets.Socket in a way that is forbidden by its access permissions.

Fault 

An invalid pointer address was detected by the underlying socket provider.

InvalidArgument 

An invalid argument was supplied to a T:System.Net.Sockets.Socket member.

TooManyOpenSockets 

There are too many open sockets in the underlying socket provider.

WouldBlock 

An operation on a nonblocking socket cannot be completed immediately.

InProgress 

A blocking operation is in progress.

AlreadyInProgress 

The nonblocking T:System.Net.Sockets.Socket already has an operation in progress.

NotSocket 

A T:System.Net.Sockets.Socket operation was attempted on a non-socket.

DestinationAddressRequired 

A required address was omitted from an operation on a T:System.Net.Sockets.Socket.

MessageSize 

The datagram is too long.

ProtocolType 

The protocol type is incorrect for this T:System.Net.Sockets.Socket.

ProtocolOption 

An unknown, invalid, or unsupported option or level was used with a T:System.Net.Sockets.Socket.

ProtocolNotSupported 

The protocol is not implemented or has not been configured.

SocketNotSupported 

The support for the specified socket type does not exist in this address family.

OperationNotSupported 

The address family is not supported by the protocol family.

ProtocolFamilyNotSupported 

The protocol family is not implemented or has not been configured.

AddressFamilyNotSupported 

The address family specified is not supported. This error is returned if the IPv6 address family was specified and the IPv6 stack is not installed on the local machine. This error is returned if the IPv4 address family was specified and the IPv4 stack is not installed on the local machine.

AddressAlreadyInUse 

Only one use of an address is normally permitted.

AddressNotAvailable 

The selected IP address is not valid in this context.

NetworkDown 

The network is not available.

NetworkUnreachable 

No route to the remote host exists.

NetworkReset 

The application tried to set F:System.Net.Sockets.SocketOptionName.KeepAlive on a connection that has already timed out.

ConnectionAborted 

The connection was aborted by the .NET Framework or the underlying socket provider.

ConnectionReset 

The connection was reset by the remote peer.

NoBufferSpaceAvailable 

No free buffer space is available for a T:System.Net.Sockets.Socket operation.

IsConnected 

The T:System.Net.Sockets.Socket is already connected.

NotConnected 

The application tried to send or receive data, and the T:System.Net.Sockets.Socket is not connected.

Shutdown 

A request to send or receive data was disallowed because the T:System.Net.Sockets.Socket has already been closed.

TimedOut 

The connection attempt timed out, or the connected host has failed to respond.

ConnectionRefused 

The remote host is actively refusing a connection.

HostDown 

The operation failed because the remote host is down.

HostUnreachable 

There is no network route to the specified host.

ProcessLimit 

Too many processes are using the underlying socket provider.

SystemNotReady 

The network subsystem is unavailable.

VersionNotSupported 

The version of the underlying socket provider is out of range.

NotInitialized 

The underlying socket provider has not been initialized.

Disconnecting 

A graceful shutdown is in progress.

TypeNotFound 

The specified class was not found.

HostNotFound 

No such host is known. The name is not an official host name or alias.

TryAgain 

The name of the host could not be resolved. Try again later.

NoRecovery 

The error is unrecoverable or the requested database cannot be located.

NoData 

The requested name or IP address was not found on the name server.

IOPending 

The application has initiated an overlapped operation that cannot be completed immediately.

OperationAborted 

The overlapped operation was aborted due to the closure of the T:System.Net.Sockets.Socket.

Definition at line 5 of file SocketError.cs.

◆ SocketFlags

Specifies socket send and receive behaviors.

Enumerator
None 

Use no flags for this call.

OutOfBand 

Process out-of-band data.

Peek 

Peek at the incoming message.

DontRoute 

Send without using routing tables.

MaxIOVectorLength 

Provides a standard value for the number of WSABUF structures that are used to send and receive data. This value is not used or supported on .NET Framework 4.5.

Truncated 

The message was too large to fit into the specified buffer and was truncated.

ControlDataTruncated 

Indicates that the control data did not fit into an internal 64-KB buffer and was truncated.

Broadcast 

Indicates a broadcast packet.

Multicast 

Indicates a multicast packet.

Partial 

Partial send or receive for message.

Definition at line 5 of file SocketFlags.cs.

◆ SocketInformationOptions

Describes states for a T:System.Net.Sockets.Socket.

Enumerator
NonBlocking 

The T:System.Net.Sockets.Socket is nonblocking.

Connected 

The T:System.Net.Sockets.Socket is connected.

Listening 

The T:System.Net.Sockets.Socket is listening for new connections.

UseOnlyOverlappedIO 

The T:System.Net.Sockets.Socket uses overlapped I/O.

Definition at line 5 of file SocketInformationOptions.cs.

◆ SocketOptionLevel

Defines socket option levels for the M:System.Net.Sockets.Socket.SetSocketOption(System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,System.Int32) and M:System.Net.Sockets.Socket.GetSocketOption(System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName) methods.

Enumerator
Socket 

T:System.Net.Sockets.Socket options apply to all sockets.

IP 

T:System.Net.Sockets.Socket options apply only to IP sockets.

IPv6 

T:System.Net.Sockets.Socket options apply only to IPv6 sockets.

Tcp 

T:System.Net.Sockets.Socket options apply only to TCP sockets.

Udp 

T:System.Net.Sockets.Socket options apply only to UDP sockets.

Definition at line 4 of file SocketOptionLevel.cs.

◆ SocketOptionName

Defines configuration option names.

Enumerator
Debug 

Record debugging information.

AcceptConnection 

The socket is listening.

ReuseAddress 

Allows the socket to be bound to an address that is already in use.

KeepAlive 

Use keep-alives.

DontRoute 

Do not route; send the packet directly to the interface addresses.

Broadcast 

Permit sending broadcast messages on the socket.

UseLoopback 

Bypass hardware when possible.

Linger 

Linger on close if unsent data is present.

OutOfBandInline 

Receives out-of-band data in the normal data stream.

DontLinger 

Close the socket gracefully without lingering.

ExclusiveAddressUse 

Enables a socket to be bound for exclusive access.

SendBuffer 

Specifies the total per-socket buffer space reserved for sends. This is unrelated to the maximum message size or the size of a TCP window.

ReceiveBuffer 

Specifies the total per-socket buffer space reserved for receives. This is unrelated to the maximum message size or the size of a TCP window.

SendLowWater 

Specifies the low water mark for Overload:System.Net.Sockets.Socket.Send operations.

ReceiveLowWater 

Specifies the low water mark for Overload:System.Net.Sockets.Socket.Receive operations.

SendTimeout 

Send a time-out. This option applies only to synchronous methods; it has no effect on asynchronous methods such as the M:System.Net.Sockets.Socket.BeginSend(System.Byte[],System.Int32,System.Int32,System.Net.Sockets.SocketFlags,System.AsyncCallback,System.Object) method.

ReceiveTimeout 

Receive a time-out. This option applies only to synchronous methods; it has no effect on asynchronous methods such as the M:System.Net.Sockets.Socket.BeginSend(System.Byte[],System.Int32,System.Int32,System.Net.Sockets.SocketFlags,System.AsyncCallback,System.Object) method.

Error 

Get the error status and clear.

Type 

Get the socket type.

ReuseUnicastPort 

Indicates that the system should defer ephemeral port allocation for outbound connections. This is equivalent to using the Winsock2 SO_REUSE_UNICASTPORT socket option.

MaxConnections 

Not supported; will throw a T:System.Net.Sockets.SocketException if used.

IPOptions 

Specifies the IP options to be inserted into outgoing datagrams.

HeaderIncluded 

Indicates that the application provides the IP header for outgoing datagrams.

TypeOfService 

Change the IP header type of the service field.

IpTimeToLive 

Set the IP header Time-to-Live field.

MulticastInterface 

Set the interface for outgoing multicast packets.

MulticastTimeToLive 

An IP multicast Time to Live.

MulticastLoopback 

An IP multicast loopback.

AddMembership 

Add an IP group membership.

DropMembership 

Drop an IP group membership.

DontFragment 

Do not fragment IP datagrams.

AddSourceMembership 

Join a source group.

DropSourceMembership 

Drop a source group.

BlockSource 

Block data from a source.

UnblockSource 

Unblock a previously blocked source.

PacketInformation 

Return information about received packets.

HopLimit 

Specifies the maximum number of router hops for an Internet Protocol version 6 (IPv6) packet. This is similar to Time to Live (TTL) for Internet Protocol version 4.

IPProtectionLevel 

Enables restriction of a IPv6 socket to a specified scope, such as addresses with the same link local or site local prefix.This socket option enables applications to place access restrictions on IPv6 sockets. Such restrictions enable an application running on a private LAN to simply and robustly harden itself against external attacks. This socket option widens or narrows the scope of a listening socket, enabling unrestricted access from public and private users when appropriate, or restricting access only to the same site, as required. This socket option has defined protection levels specified in the T:System.Net.Sockets.IPProtectionLevel enumeration.

IPv6Only 

Indicates if a socket created for the AF_INET6 address family is restricted to IPv6 communications only. Sockets created for the AF_INET6 address family may be used for both IPv6 and IPv4 communications. Some applications may want to restrict their use of a socket created for the AF_INET6 address family to IPv6 communications only. When this value is non-zero (the default on Windows), a socket created for the AF_INET6 address family can be used to send and receive IPv6 packets only. When this value is zero, a socket created for the AF_INET6 address family can be used to send and receive packets to and from an IPv6 address or an IPv4 address. Note that the ability to interact with an IPv4 address requires the use of IPv4 mapped addresses. This socket option is supported on Windows Vista or later.

NoDelay 

Disables the Nagle algorithm for send coalescing.

BsdUrgent 

Use urgent data as defined in RFC-1222. This option can be set only once; after it is set, it cannot be turned off.

Expedited 

Use expedited data as defined in RFC-1222. This option can be set only once; after it is set, it cannot be turned off.

NoChecksum 

Send UDP datagrams with checksum set to zero.

ChecksumCoverage 

Set or get the UDP checksum coverage.

UpdateAcceptContext 

Updates an accepted socket's properties by using those of an existing socket. This is equivalent to using the Winsock2 SO_UPDATE_ACCEPT_CONTEXT socket option and is supported only on connection-oriented sockets.

UpdateConnectContext 

Updates a connected socket's properties by using those of an existing socket. This is equivalent to using the Winsock2 SO_UPDATE_CONNECT_CONTEXT socket option and is supported only on connection-oriented sockets.

Definition at line 4 of file SocketOptionName.cs.

◆ SocketShutdown

Defines constants that are used by the M:System.Net.Sockets.Socket.Shutdown(System.Net.Sockets.SocketShutdown) method.

Enumerator
Receive 

Disables a T:System.Net.Sockets.Socket for receiving. This field is constant.

Send 

Disables a T:System.Net.Sockets.Socket for sending. This field is constant.

Both 

Disables a T:System.Net.Sockets.Socket for both sending and receiving. This field is constant.

Definition at line 4 of file SocketShutdown.cs.

◆ SocketType

Specifies the type of socket that an instance of the T:System.Net.Sockets.Socket class represents.

Enumerator
Stream 

Supports reliable, two-way, connection-based byte streams without the duplication of data and without preservation of boundaries. A Socket of this type communicates with a single peer and requires a remote host connection before communication can begin. F:System.Net.Sockets.SocketType.Stream uses the Transmission Control Protocol (F:System.Net.Sockets.ProtocolType.Tcp) T:System.Net.Sockets.ProtocolType and the InterNetworkT:System.Net.Sockets.AddressFamily.

Dgram 

Supports datagrams, which are connectionless, unreliable messages of a fixed (typically small) maximum length. Messages might be lost or duplicated and might arrive out of order. A T:System.Net.Sockets.Socket of type F:System.Net.Sockets.SocketType.Dgram requires no connection prior to sending and receiving data, and can communicate with multiple peers. F:System.Net.Sockets.SocketType.Dgram uses the Datagram Protocol (F:System.Net.Sockets.ProtocolType.Udp) and the F:System.Net.Sockets.AddressFamily.InterNetworkT:System.Net.Sockets.AddressFamily.

Raw 

Supports access to the underlying transport protocol. Using the T:System.Net.Sockets.SocketTypeF:System.Net.Sockets.SocketType.Raw, you can communicate using protocols like Internet Control Message Protocol (F:System.Net.Sockets.ProtocolType.Icmp) and Internet Group Management Protocol (F:System.Net.Sockets.ProtocolType.Igmp). Your application must provide a complete IP header when sending. Received datagrams return with the IP header and options intact.

Rdm 

Supports connectionless, message-oriented, reliably delivered messages, and preserves message boundaries in data. Rdm (Reliably Delivered Messages) messages arrive unduplicated and in order. Furthermore, the sender is notified if messages are lost. If you initialize a Socket using F:System.Net.Sockets.SocketType.Rdm, you do not require a remote host connection before sending and receiving data. With F:System.Net.Sockets.SocketType.Rdm, you can communicate with multiple peers.

Seqpacket 

Provides connection-oriented and reliable two-way transfer of ordered byte streams across a network. F:System.Net.Sockets.SocketType.Seqpacket does not duplicate data, and it preserves boundaries within the data stream. A Socket of type F:System.Net.Sockets.SocketType.Seqpacket communicates with a single peer and requires a remote host connection before communication can begin.

Unknown 

Specifies an unknown Socket type.

Definition at line 4 of file SocketType.cs.

◆ TransmitFileOptions

The T:System.Net.Sockets.TransmitFileOptions enumeration defines values used in file transfer requests.

Enumerator
UseDefaultWorkerThread 

Use the default thread to process long file transfer requests.

Disconnect 

Start a transport-level disconnect after all the file data has been queued for transmission. When used with F:System.Net.Sockets.TransmitFileOptions.ReuseSocket, these flags return the socket to a disconnected, reusable state after the file has been transmitted.

ReuseSocket 

The socket handle may be reused when the request completes. This flag is valid only if F:System.Net.Sockets.TransmitFileOptions.Disconnect is also specified. When used with F:System.Net.Sockets.TransmitFileOptions.Disconnect, these flags return the socket to a disconnected, reusable state after the file has been transmitted.

WriteBehind 

Complete the file transfer request immediately, without pending. If this flag is specified and the file transfer succeeds, the data has been accepted by the system but not necessarily acknowledged by the remote end. Do not use this flag with the F:System.Net.Sockets.TransmitFileOptions.Disconnect and F:System.Net.Sockets.TransmitFileOptions.ReuseSocket flags.

UseSystemThread 

Use system threads to process long file transfer requests.

UseKernelApc 

Use kernel asynchronous procedure calls (APCs) instead of worker threads to process long file transfer requests. Long requests are defined as requests that require more than a single read from the file or a cache; the request therefore depends on the size of the file and the specified length of the send packet.

Definition at line 5 of file TransmitFileOptions.cs.