Socket.SendTimeout Property

Note: This property is new in the .NET Framework version 2.0.

Gets or sets a value that specifies the amount of time after which a synchronous Send call will time out.

Namespace: System.Net.Sockets
Assembly: System (in system.dll)

'Declaration
Public Property SendTimeout As Integer
'Usage
Dim instance As Socket
Dim value As Integer

value = instance.SendTimeout

instance.SendTimeout = value
/** @property */
public int get_SendTimeout ()

/** @property */
public void set_SendTimeout (int value)

public function get SendTimeout () : int

public function set SendTimeout (value : int)

Property Value

The time-out value, in milliseconds. If you set the property with a value between 1 and 499, the value will be changed to 500. The default value is 0, which indicates an infinite time-out period. Specifying -1 also indicates an infinite time-out period.

Exception typeCondition

SocketException

An error occurred when attempting to access the socket.

ObjectDisposedException

The Socket has been closed.

ArgumentOutOfRangeException

The value specified for a set operation is less than -1.

This option applies to synchronous Send calls only. If the time-out period is exceeded, the Send method will throw a SocketException.

The following code example demonstrates the use of the SendTimeout property.

No code example is currently available or this language may not be supported.

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show: