System.Net.Sockets.SocketOptionLevel Enum

public enum SocketOptionLevel

Base Types

Object
  ValueType
    Enum
      SocketOptionLevel

Assembly

System

Library

Networking

Summary

Specifies the option level associated with the SocketOptionName used 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.

Description

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.

See Also

System.Net.Sockets Namespace

Members

SocketOptionLevel Fields

SocketOptionLevel.IP Field
SocketOptionLevel.Socket Field
SocketOptionLevel.Tcp Field
SocketOptionLevel.Udp Field
SocketOptionLevel.value__ Field


SocketOptionLevel.IP Field

IP = 0;

Summary

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

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

SocketOptionNameDescription of Socket Option Data
HeaderIncludedA Boolean 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 Int32 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 Boolean where true enables multicast loopback.
MulticastTimeToLiveA Int32 that specifies the time-to-live for multicast datagrams.
TypeOfServiceA Int32 that specifies the type of service field in the IP header.
UseLoopbackA Boolean where true indicates Bypass hardware when possible.

See Also

System.Net.Sockets.SocketOptionLevel Enum, System.Net.Sockets Namespace

SocketOptionLevel.Socket Field

Socket = 65535;

Summary

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

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

SocketOptionNameDescription
BroadcastA Boolean where true indicates broadcast messages are allowed to be sent to the socket.
DebugA Boolean where true indicates to record debugging information.
DontLingerA Boolean where true indicates to close the socket without lingering.
DontRouteA Boolean where true indicates not to route data; false indicates to send data directly to interface addresses.
ErrorA Int32 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 Boolean where true (the default) indicates to enable keep-alives, which allows a connection to remain open after a request.
OutOfBandInlineA Boolean where true indicates to receive out-of-band data in the normal data stream.
ReceiveBufferA Int32 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 Int32 that 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.
ReuseAddressA Boolean where true allows the socket to be bound to an address that is already in use.
SendBufferA Int32 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 Int32 that 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.
TypeOne of the values defined in the SocketType enumeration. This option is read-only.

See Also

System.Net.Sockets.SocketOptionLevel Enum, System.Net.Sockets Namespace

SocketOptionLevel.Tcp Field

Tcp = 6;

Summary

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

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

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

See Also

System.Net.Sockets.SocketOptionLevel Enum, System.Net.Sockets Namespace

SocketOptionLevel.Udp Field

Udp = 17;

Summary

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

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

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

See Also

System.Net.Sockets.SocketOptionLevel Enum, System.Net.Sockets Namespace

SocketOptionLevel.value__ Field

value__;

See Also

System.Net.Sockets.SocketOptionLevel Enum, System.Net.Sockets Namespace