Java.Net.SocketOptions.SoLinger Field
Number of seconds to wait when closing a socket if there is still some buffered data to be sent.

Value: 128

Syntax

[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.")]
public const SocketOption SoLinger

Remarks

Number of seconds to wait when closing a socket if there is still some buffered data to be sent.

The option can be set to disabled using SocketOptions.setOption(int, java.lang.Object) with a value of Boolean.FALSE.

If this option is set to 0, the TCP socket is closed forcefully and the call to close returns immediately. If this option is disabled, closing a socket will return immediately and the close will be handled in the background.

If this option is set to a value greater than 0, the value is interpreted as the number of seconds to wait. If all data could be sent during this time, the socket is closed normally. Otherwise the connection will be closed forcefully.

Valid numeric values for this option are in the range 0 to 65535 inclusive. (Larger timeouts will be treated as 65535s timeouts; roughly 18 hours.)

This option is intended for use with sockets in blocking mode. The behavior of this option for non-blocking sockets is undefined.

[Android Documentation]

Requirements

Namespace: Java.Net
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1