socket_object.ReceiveTimeout Property

Sets or Gets the timeout period, in milliseconds, for a Socket to block while waiting to receive data.

socket_object.ReceiveTimeout= <timeout>
-or-
...socket_object.ReceiveTimeout

Prerequisites

The Socket must currently be open to set this property.

Parameters

None

Remarks

This property allows you to set the timeout period for a Receive or ReceiveFrom method. It only applies if the Socket is set to blocking. If a receive request blocks waiting for data, it will only wait for the specified timeout period. If that time is exceeded, the receive requests throws an Exception. If the timeout period is set to 0, the timeout is disabled and a request may block indefinitely.

Examples

ts.ReceiveTimeout = 30000   ' Timeout in 30 seconds
ts.Receive(recv, 1500) ' Receive the data

See Also

Networking Classes | socket_object.Blocking| socket_object.SendTimeout