Share this page

# lrs_set_recv_timeout

Timeout Functions

Sets a timeout for receiving the expected data on a socket.

    void lrs_set_recv_timeout( long sec, long u_sec );

sec | The desired timeout in seconds (default: 10 seconds).
u_sec | The desired timeout in microseconds (which is added to the sec parameter)

The lrs_set_recv_timeout function sets the period of time that VuGen waits to receive expected data from a socket.

Note: Note that if, by this time, the buffer size does not match the expected data size (i.e it is smaller or larger), lrs_receive will re-read the incoming data carried by the socket, until a second timeout has elapsed. For more information, see lrs_set_recv_timeout2.

By default the receive timeout is 10 seconds. The timeout is global for all sockets and is valid until the next invocation of lrs_set_recv_timeout.

This function is not recorded during a WinSock session —you must manually insert it into your script.

## Return Values

This function has no return value.

## Parameterization

You cannot use standard parameterization for any arguments in this function.

## Example

In the following example, lrs_set_recv_timeout specifies a timeout of 120 seconds for a login procedure. Because the recorded (and expected) login screen may take several minutes to appear, the timeout was modified from 10 to 120 seconds.

Copy code

    lrs_create_socket("socket2", "TCP", "RemoteHost=tears.abc.co.il:23", LrsLastArg);
    lrs_send("socket2", "buf2", LrsLastArg);
    lrs_set_recv_timeout(120, 0);
    lrs_receive("socket2", "buf3", LrsLastArg);

Tips to improve your search results... VuGen Function Reference Version 26.1-26.3 Function Reference 26.1-26.3 All View Local Help Center View Online Help Center Version: