Share via


DatagramSocket.SoTimeout Property

Definition

Retrieve setting for SO_TIMEOUT. -or- Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds.

public virtual int SoTimeout { [Android.Runtime.Register("getSoTimeout", "()I", "GetGetSoTimeoutHandler")] get; [Android.Runtime.Register("setSoTimeout", "(I)V", "GetSetSoTimeout_IHandler")] set; }
[<get: Android.Runtime.Register("getSoTimeout", "()I", "GetGetSoTimeoutHandler")>]
[<set: Android.Runtime.Register("setSoTimeout", "(I)V", "GetSetSoTimeout_IHandler")>]
member this.SoTimeout : int with get, set

Property Value

the setting for SO_TIMEOUT

Attributes

Exceptions

if an error occurs while getting the option value.

if an error occurs while setting the option.

Remarks

Property getter documentation:

Retrieve setting for SO_TIMEOUT. 0 returns implies that the option is disabled (i.e., timeout of infinity).

Added in 1.1.

Java documentation for java.net.DatagramSocket.getSoTimeout().

Property setter documentation:

Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds. With this option set to a non-zero timeout, a call to receive() for this DatagramSocket will block for only this amount of time. If the timeout expires, a <B>java.net.SocketTimeoutException</B> is raised, though the DatagramSocket is still valid. The option <B>must</B> be enabled prior to entering the blocking operation to have effect. The timeout must be > 0. A timeout of zero is interpreted as an infinite timeout.

Added in 1.1.

Java documentation for java.net.DatagramSocket.setSoTimeout(int).

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