Condividi tramite


Socket.SoTimeout Property

Definition

Returns setting for SocketOptions#SO_TIMEOUT SO_TIMEOUT. -or- Enable/disable SocketOptions#SO_TIMEOUT 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 SocketOptions#SO_TIMEOUT SO_TIMEOUT

Attributes

Exceptions

Remarks

Property getter documentation:

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

Added in 1.1.

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

Property setter documentation:

Enable/disable SocketOptions#SO_TIMEOUT SO_TIMEOUT with the specified timeout, in milliseconds. With this option set to a non-zero timeout, a read() call on the InputStream associated with this Socket will block for only this amount of time. If the timeout expires, a <B>java.net.SocketTimeoutException</B> is raised, though the Socket 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.Socket.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