Sdílet prostřednictvím


SocketOptions.SoLinger Field

Definition

Caution

This constant will be removed in the future version. Use Java.Net.SocketOption enum directly instead of this field.

Specify a linger-on-close timeout.

[Android.Runtime.Register("SO_LINGER")]
[System.Obsolete("This constant will be removed in the future version. Use Java.Net.SocketOption enum directly instead of this field.", true)]
public const Java.Net.SocketOption SoLinger = 128;
[<Android.Runtime.Register("SO_LINGER")>]
[<System.Obsolete("This constant will be removed in the future version. Use Java.Net.SocketOption enum directly instead of this field.", true)>]
val mutable SoLinger : Java.Net.SocketOption

Field Value

Value = 128
Attributes

Remarks

Specify a linger-on-close timeout. This option disables/enables immediate return from a <B>close()</B> of a TCP Socket. Enabling this option with a non-zero Integer timeout means that a <B>close()</B> will block pending the transmission and acknowledgement of all data written to the peer, at which point the socket is closed gracefully. Upon reaching the linger timeout, the socket is closed forcefully, with a TCP RST. Enabling the option with a timeout of zero does a forceful close immediately. If the specified timeout value exceeds 65,535 it will be reduced to 65,535.

Valid only for TCP: SocketImpl

Java documentation for java.net.SocketOptions.SO_LINGER.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to