Mono Class Library: System.Net.Sockets Namespace

System.Net.Sockets.SocketOptionLevel Enumeration

Specifies the option level associated with the System.Net.Sockets.SocketOptionName used in the Socket.SetSocketOption(SocketOptionLevel, SocketOptionName, int) and Socket.GetSocketOption(SocketOptionLevel, SocketOptionName) methods of the System.Net.Sockets.Socket class. [Edit]
public enum SocketOptionLevel

Remarks

Some socket options apply only to specific protocols while others apply to all types. Members of this enumeration specify which protocol applies to a specific socket option. [Edit]

Members

Member NameDescription
IP

Specifies that members of the System.Net.Sockets.SocketOptionName enumeration apply to Internet Protocol (IP).

The following table lists the members of the System.Net.Sockets.SocketOptionName enumeration used with this level.

SocketOptionNameDescription of Socket Option Data
HeaderIncludedA bool where true indicates the application is providing the IP header for outgoing datagrams.
IPOptionsA byte array that specifies IP options to be inserted into outgoing datagrams.
IpTimeToLiveA int that specifies the time-to-live for datagrams. The time-to-live designates the number of networks on which the datagram is allowed to travel before being discarded by a router.
MulticastInterfaceA byte array that specifies the interface for outgoing multicast packets.
MulticastLoopbackA bool where true enables multicast loopback.
MulticastTimeToLiveA int that specifies the time-to-live for multicast datagrams.
TypeOfServiceA int that specifies the type of service field in the IP header.
UseLoopbackA bool where true indicates Bypass hardware when possible.
[Edit]
IPv6Documentation for this section has not yet been entered. [Edit]
Socket

Specifies that members of the System.Net.Sockets.SocketOptionName enumeration are not specific to a particular protocol.

The following table lists the members of the System.Net.Sockets.SocketOptionName enumeration used with this level.

SocketOptionNameDescription
BroadcastA bool where true indicates broadcast messages are allowed to be sent to the socket.
DebugA bool where true indicates to record debugging information.
DontLingerA bool where true indicates to close the socket without lingering.
DontRouteA bool where true indicates not to route data; false indicates to send data directly to interface addresses.
ErrorA int that contains the error code associated with the last socket error. The error code is cleared by this option. This option is read-only.
KeepAliveA bool where true (the default) indicates to enable keep-alives, which allows a connection to remain open after a request.
OutOfBandInlineA bool where true indicates to receive out-of-band data in the normal data stream.
ReceiveBufferA int that 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.
ReceiveTimeoutA int that specifies the maximum time, in milliseconds, the Socket.Receive(Byte[], int, SocketFlags) and Socket.ReceiveFrom(Byte[], int, int, SocketFlags, System.Net.EndPoint@) methods will block when attempting to receive data. If data is not received within this time, a System.Net.Sockets.SocketException exception is thrown.
ReuseAddressA bool where true allows the socket to be bound to an address that is already in use.
SendBufferA int that 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.
SendTimeoutA int that specifies the maximum time, in milliseconds, the Socket.Send(Byte[], int, SocketFlags) and Socket.SendTo(Byte[], int, int, SocketFlags, System.Net.EndPoint) methods will block when attempting to send data. If data is not sent within this time, a System.Net.Sockets.SocketException exception is thrown.
Type

One of the values defined in the System.Net.Sockets.SocketType enumeration. This option is read-only.

[Edit]
Tcp

Specifies that members of the System.Net.Sockets.SocketOptionName enumeration apply to Transmission Control Protocol (TCP).

The following table lists the members of the System.Net.Sockets.SocketOptionName enumeration used with this level.

SocketOptionNameDescription of Socket Option Data
BsdUrgentA bool where true indicates to use urgent data as defined by IETF RFC 1222. Once set, this option cannot be turned off.
ExpeditedA bool where true indicates to use expedited data as defined by IETF RFC 1222. Once set, this option cannot be turned off.
NoDelayA bool where true indicates to disable the Nagle algorithm for send coalescing.
[Edit]
Udp

Specifies that members of the System.Net.Sockets.SocketOptionName enumeration apply to User Datagram Protocol (UDP).

The following table lists the members of the System.Net.Sockets.SocketOptionName enumeration used with this level.

SocketOptionNameDescription of Socket Option Data
ChecksumCoverageA bool that specifies UDP checksum coverage.
NoChecksumA bool where true indicates to send UDP datagrams with the checksum set to zero.
[Edit]

Requirements

Namespace: System.Net.Sockets
Assembly: System (in System.dll)
Assembly Versions: 1.0.x.x, 1.0.5000.0, 2.0.0.0