Share via


Socket.SetSocketOption Method

Sets the specified configuration option for the current socket.

Overload List

Name Description
Socket.SetSocketOption (SocketOptionLevel, SocketOptionName, Boolean) Sets the specified Boolean configuration option for the current socket.
Socket.SetSocketOption (SocketOptionLevel, SocketOptionName, Int32) Sets the specified integer configuration option for the current socket.

Remarks

The configuration options determine the behavior of the socket. For an option that is a Boolean data type, specify true to enable the option, or specify false to disable the option. For an option that is an integer data type, specify the appropriate numeric value.

Only certain configuration options can be set. The following lists show the options that you can set. The configuration options are grouped by level of protocol support, which is specified by the SocketOptionLevel enumeration. If you intend to set any of these options, be sure to use the appropriate SocketOptionLevel value for the optionLevel parameter.

Configuration options that apply to the protocol specified by the SocketOptionLevel.Socket value:

Configuration options that apply to the protocol specified by the SocketOptionLevel.IP value:

Configuration options that apply to the protocol specified by the SocketOptionLevel.Tcp value:

Configuration options that apply to the protocol specified by the SocketOptionLevel.Udp value:

Version Information

Available in .NET Micro Framework version 2.0, 2.5

See Also

Reference

Socket Class
Socket Members
System.Net.Sockets Namespace