Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
enum System.​Net.​Sockets.​SocketOptionName
Assembly: System.Net.Sockets
Defines configuration option names.
Values
DontLinger
Close the socket gracefully without lingering.
ExclusiveAddressUse
Enables a socket to be bound for exclusive access.
Debug
Record debugging information.
IPOptions
Specifies the IP options to be inserted into outgoing datagrams.
NoChecksum
Send UDP datagrams with checksum set to zero.
NoDelay
Disables the Nagle algorithm for send coalescing.
AcceptConnection
The socket is listening.
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.
HeaderIncluded
Indicates that the application provides the IP header for outgoing datagrams.
TcpKeepAliveTime
The number of seconds a TCP connection will remain alive/idle before keepalive probes are sent to the remote.
TypeOfService
Change the IP header type of the service field.
IpTimeToLive
Set the IP header Time-to-Live field.
ReuseAddress
Allows the socket to be bound to an address that is already in use.
KeepAlive
Use keep-alives.
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.
FastOpen
Enables TCP Fast Open as defined in RFC-7413. The actual observed behavior depends on OS configuration and the state of the kernel TCP cookie cache. Using TFO is only recommended in controlled networking environments, meaning that each middlebox (for example, firewall, router, proxy) on the networking path between the client and server is known and can be configured to support TFO. Using TFO outside of controlled environments (such as the open internet) can lead to connectivity issues.
DontRoute
Do not route; send the packet directly to the interface addresses.
DropSourceMembership
Drop a source group.
TcpKeepAliveRetryCount
The number of TCP keep alive probes that will be sent before the connection is terminated.
BlockSource
Block data from a source.
TcpKeepAliveInterval
The number of seconds a TCP connection will wait for a keepalive response before sending another keepalive probe.
UnblockSource
Unblock a previously blocked source.
PacketInformation
Return information about received packets.
ChecksumCoverage
Set or get the UDP checksum coverage.
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 <see cref="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.
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.
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 <see cref="Overload:System.Net.Sockets.Socket.Send" /> operations.
ReceiveLowWater
Specifies the low water mark for <see cref="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 <see cref="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 <see cref="M:System.Net.Sockets.Socket.BeginSend(System.Byte[],System.Int32,System.Int32,System.Net.Sockets.SocketFlags,System.AsyncCallback,System.Object)" /> method.
Error
Gets the error status and clear.
Type
Gets 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.
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.
MaxConnections
Not supported; will throw a <see cref="T:System.Net.Sockets.SocketException" /> if used.