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, byte[]) | Sets the specified integer configuration option for the current socket. |
Socket.SetSocketOption (SocketOptionLevel, SocketOptionName, Int32) | Sets the specified integer configuration option for the current socket. |
Socket.SetSocketOption (SocketOptionLevel, SocketOptionName, Object) | 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:
- SocketOptionName.AcceptConnection
- SocketOptionName.Broadcast
- SocketOptionName.DontLinger
- SocketOptionName.Debug
- SocketOptionName.KeepAlive
- SocketOptionName.OutOfBandInline
- SocketOptionName.ReuseAddress
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 the .NET Micro Framework versions 2.0, 2.5, 3.0, 4.0, 4.1, and 4.2.