Share this page

# lrs_accept_connection

Sockets Functions

Accepts a connection on a socket.

    int lrs_accept_connection( char *old_socket, char *new_socket );

old_socket | A descriptor identifying a socket which is ready for connections.
new_socket | A descriptor identifying a new socket to be connected with an existing one.

The lrs_accept_connection function extracts the first connection on the queue of pending connections on old_socket, creates a new socket with the same properties. The original socket remains available for additional connections.

This function is recorded during a Windows Socket session.

## Return Values

Windows Sockets Return Values

## Parameterization

Parameterization is not applicable to this function.

## Example

In the following example, socket four is established to listen to an incoming connection. The lrs_accept_connection function creates a new socket (socket five) to accept the connection and send data to the server.

     /* accept(): socket 5 accepted via socket 4 */

    lrs_accept_connection("socket4", "socket5");

     /* send(): Send to socket 5 */

    lrs_send ("socket5", "buf5", "TargetSocket=199.203.77.246:21", LrsLastArg );

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