public enum SocketOptionName
Object
ValueType
Enum
SocketOptionName
System
Networking
Specifies option names for use in the System.Net.Sockets.Socket.SetSocketOption(System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,System.Int32) and System.Net.Sockets.Socket.GetSocketOption(System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName) methods of the Socket class.
Socket options determine the behavior of an instance of the Socket class. Some socket options apply only to specific protocols while others apply to all types. Members of the SocketOptionLevel enumeration specify which protocol applies to a specific socket option.
System.Net.Sockets Namespace
SocketOptionName Fields
SocketOptionName.AcceptConnection Field
SocketOptionName.AddMembership Field
SocketOptionName.AddSourceMembership Field
SocketOptionName.BlockSource Field
SocketOptionName.Broadcast Field
SocketOptionName.BsdUrgent Field
SocketOptionName.ChecksumCoverage Field
SocketOptionName.Debug Field
SocketOptionName.DontFragment Field
SocketOptionName.DontLinger Field
SocketOptionName.DontRoute Field
SocketOptionName.DropMembership Field
SocketOptionName.DropSourceMembership Field
SocketOptionName.Error Field
SocketOptionName.ExclusiveAddressUse Field
SocketOptionName.Expedited Field
SocketOptionName.HeaderIncluded Field
SocketOptionName.IPOptions Field
SocketOptionName.IpTimeToLive Field
SocketOptionName.KeepAlive Field
SocketOptionName.Linger Field
SocketOptionName.MaxConnections Field
SocketOptionName.MulticastInterface Field
SocketOptionName.MulticastLoopback Field
SocketOptionName.MulticastTimeToLive Field
SocketOptionName.NoChecksum Field
SocketOptionName.NoDelay Field
SocketOptionName.OutOfBandInline Field
SocketOptionName.PacketInformation Field
SocketOptionName.ReceiveBuffer Field
SocketOptionName.ReceiveLowWater Field
SocketOptionName.ReceiveTimeout Field
SocketOptionName.ReuseAddress Field
SocketOptionName.SendBuffer Field
SocketOptionName.SendLowWater Field
SocketOptionName.SendTimeout Field
SocketOptionName.Type Field
SocketOptionName.TypeOfService Field
SocketOptionName.UnblockSource Field
SocketOptionName.UseLoopback Field
SocketOptionName.value__ Field
AcceptConnection = 2;
System.Net.Sockets.Socket.Listen(System.Int32) has been called on the socket.The value associated with this option is a Boolean data type.
The System.Net.Sockets.SocketOptionLevel.Socket value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
AddMembership = 12;
Add an IP group membership.The value associated with this option is an instance of the MulticastOption class.
The System.Net.Sockets.SocketOptionLevel.IP value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
AddSourceMembership = 15;
Join a source group.The value associated with this option is an instance of the IPAddress class.
The System.Net.Sockets.SocketOptionLevel.IP value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
BlockSource = 17;
Block data from a source.The value associated with this option is a Boolean data type.
The System.Net.Sockets.SocketOptionLevel.IP value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
Broadcast = 32;
Permit sending broadcast messages on the socket.The value associated with this option is a Boolean data type.
The System.Net.Sockets.SocketOptionLevel.Socket value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
BsdUrgent = 2;
Use urgent data as defined by IETF RFC 1222. This option can be set only once, and once set, cannot be turned off.The value associated with this option is a Boolean data type.
The System.Net.Sockets.SocketOptionLevel.Tcp value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
ChecksumCoverage = 20;
Set or get UDP checksum coverage.The value associated with this option is a Boolean data type.
The System.Net.Sockets.SocketOptionLevel.Udp value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
Debug = 1;
Record debugging information when available.The value associated with this option is a Boolean data type.
The System.Net.Sockets.SocketOptionLevel.Socket value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
DontFragment = 14;
Do not fragment IP datagrams.The value associated with this option is a Boolean data type.
The System.Net.Sockets.SocketOptionLevel.IP value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
DontLinger = -129;
Close socket gracefully without lingering.The value associated with this option is a Boolean data type.
The System.Net.Sockets.SocketOptionLevel.Socket value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
DontRoute = 16;
Do not route; send directly to interface addresses.The value associated with this option is a Boolean data type.
The System.Net.Sockets.SocketOptionLevel.Socket value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
DropMembership = 13;
Drop an IP group membership.The value associated with this option is an instance of the MulticastOption class.
The System.Net.Sockets.SocketOptionLevel.IP value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
DropSourceMembership = 16;
Drop a source group.The value associated with this option is an instance of the IPAddress class.
The System.Net.Sockets.SocketOptionLevel.IP value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
Error = 4103;
Get the error status code, then clear the code.The value associated with this option is a Int32 data type.
The System.Net.Sockets.SocketOptionLevel.Socket value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
ExclusiveAddressUse = -5;
Enable a socket to be bound for exclusive access.The value associated with this option is a Boolean data type.
The System.Net.Sockets.SocketOptionLevel.Socket value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
Expedited = 2;
Use expedited data as defined by IETF RFC 1222. This option can be set only once, and once set, cannot be turned off.The value associated with this option is a Boolean data type.
The System.Net.Sockets.SocketOptionLevel.Tcp value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
HeaderIncluded = 2;
Application is providing the IP header for outgoing datagrams.The value associated with this option is a Boolean data type.
The System.Net.Sockets.SocketOptionLevel.IP value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
IPOptions = 1;
Specifies IP options to be inserted into outgoing datagrams.The value associated with this option is a Byte array.
The System.Net.Sockets.SocketOptionLevel.IP value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
IpTimeToLive = 4;
Set the IP header time-to-live field.The value associated with this option is a Int32 data type.
The System.Net.Sockets.SocketOptionLevel.IP value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
KeepAlive = 8;
Send keep-alives.The value associated with this option is a Boolean data type.
The System.Net.Sockets.SocketOptionLevel.Socket value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
Linger = 128;
Linger on close if unsent data is present.The value associated with this option is an instance of the LingerOption class.
The System.Net.Sockets.SocketOptionLevel.Socket value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
MaxConnections = 2147483647;
Maximum queue length that can be specified by System.Net.Sockets.Socket.Listen(System.Int32).The value associated with this option is a Int32 data type.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
MulticastInterface = 9;
Set the interface for outgoing multicast packets.The value associated with this option is a Byte array.
The System.Net.Sockets.SocketOptionLevel.IP value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
MulticastLoopback = 11;
IP multicast loopback.The value associated with this option is a Boolean data type.
The System.Net.Sockets.SocketOptionLevel.IP value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
MulticastTimeToLive = 10;
IP multicast time to live.The value associated with this option is a Int32 data type.
The System.Net.Sockets.SocketOptionLevel.IP value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
NoChecksum = 1;
Send UDP datagrams with checksum set to zero.The value associated with this option is a Boolean data type.
The System.Net.Sockets.SocketOptionLevel.Udp value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
NoDelay = 1;
Disable the Nagle algorithm for send coalescing.The value associated with this option is a Boolean data type.
The System.Net.Sockets.SocketOptionLevel.Tcp value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
OutOfBandInline = 256;
Receive out-of-band data in the normal data stream.The value associated with this option is a Boolean data type.
The System.Net.Sockets.SocketOptionLevel.Socket value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
PacketInformation = 19;
Return information about received packets.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
ReceiveBuffer = 4098;
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.The value associated with this option is a Int32 data type.
The System.Net.Sockets.SocketOptionLevel.Socket value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
ReceiveLowWater = 4100;
Receive low water mark.The value associated with this option is a Int32 data type.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
ReceiveTimeout = 4102;
Specifies the maximum time, in milliseconds, the System.Net.Sockets.Socket.Receive(System.Byte[],System.Int32,System.Net.Sockets.SocketFlags) and System.Net.Sockets.Socket.ReceiveFrom(System.Byte[],System.Int32,System.Int32,System.Net.Sockets.SocketFlags,System.Net.EndPoint@) methods will block when attempting to receive data. If data is not received within this time, a SocketException exception is thrown.The value associated with this option is a Int32 data type.
The System.Net.Sockets.SocketOptionLevel.Socket value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
ReuseAddress = 4;
Allow the socket to be bound to an address that is already in use.The value associated with this option is a Boolean data type.
The System.Net.Sockets.SocketOptionLevel.Socket value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
SendBuffer = 4097;
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.The value associated with this option is a Int32 data type.
The System.Net.Sockets.SocketOptionLevel.Socket value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
SendLowWater = 4099;
Send low water mark.The value associated with this option is a Int32 data type.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
SendTimeout = 4101;
Specifies the maximum time, in milliseconds, the System.Net.Sockets.Socket.Send(System.Byte[],System.Int32,System.Net.Sockets.SocketFlags) and System.Net.Sockets.Socket.SendTo(System.Byte[],System.Int32,System.Int32,System.Net.Sockets.SocketFlags,System.Net.EndPoint) methods will block when attempting to send data. If data is not sent within this time, a SocketException exception is thrown.The value associated with this option is a Int32 data type.
The System.Net.Sockets.SocketOptionLevel.Socket member of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
Type = 4104;
Get the socket type, one of the members of the SocketType enumeration.The value associated with this option is a Int32 data type.
The System.Net.Sockets.SocketOptionLevel.Socket value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
TypeOfService = 3;
Change the IP header type of service field.The System.Net.Sockets.SocketOptionLevel.IP value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
UnblockSource = 18;
Unblock a previously blocked source.The value associated with this option is a Boolean data type.
The System.Net.Sockets.SocketOptionLevel.IP value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
UseLoopback = 64;
Bypass hardware when possible.The value associated with this option is a Boolean data type.
The System.Net.Sockets.SocketOptionLevel.IP value of the SocketOptionLevel enumeration applies to this option.
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace
value__;
System.Net.Sockets.SocketOptionName Enum, System.Net.Sockets Namespace