Share this page

# lrs_set_accept_timeout

Timeout Functions

Sets a timeout for accepting a socket.

    void lrs_set_accept_timeout( long seconds, long u_sec );

seconds | The desired timeout in seconds.
u_sec | The desired timeout in microseconds (added to the sec. parameter)

The lrs_set_accept_timeout function sets the amount of time the server waits to detect a readable socket (select), and complete the association (accept). If the socket is currently listening, it will be marked as readable if an incoming connection request was received. Once a socket is marked as readable, an accept is guaranteed to complete without blocking. You can specify seconds and microseconds for the timeout. If a socket was not accepted within the timeout interval, the script execution will terminate. The default timeout is 10 seconds. If you see that the default time is insufficient for you, modify it accordingly.

Note that the timeout value set with this function is used for all sockets until the next call to lrs_set_accept_timeout.

This function is not recorded during a WinSock session—you 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_accept_timeout specifies a timeout of 30 seconds.

Copy code

    lrs_set_accept_timeout(30,0);
    lrs_create_socket("socket2", "TCP", "LocalPort=625", "Backlog=5", LrsLastArg);
     /* accept(): socket 3 accepted via socket 2 */
    lrs_accept_connection("socket"2, "socket3");
     /* send(): Sent to socket 3 */
    "lrs_send ("socket3", "buf5", "TargetSocket=199.203.77.246:21", 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: