Share this page

# lrs_send

Sockets Functions

Sends data on a datagram or a stream socket.

    int lrs_send( char *s_desc, char *buf_desc, [char *target], [char *flags,] LrsLastArg );

s_desc | A descriptor identifying a connected socket.
buf_desc | A descriptor identifying a buffer. For details on editing the Windows Sockets Buffers, see the Windows Sockets protocol in the VuGen User Guide.
target | The IP address of the target host in dotted form or the host name in the following format: "`TargetSocket=host:port`" (optional)
flags | Receive and Send Flags that specify the way in which the call is made (optional). Use the following format:"Flags=flags"
LrsLastArg | A marker indicating the end of the parameters (used where optional parameters are available).

The lrs_send function writes outgoing data to a connected datagram or stream sockets. If it does not succeed in sending all of the data in the buffer, it attempts to do so until the send timeout. If it cannot find a writable socket for the data, the function continues to look for a socket until the send timeout. By default the send timeout is 10 seconds. You can modify the timeout using lrs_set_send_timeout. Note that the successful completion of a lrs_send does not indicate that the data was successfully delivered.

If no buffer space is available within the transport system to hold the data, lrs_send blocks the transmission unless the socket has been placed in a non-blocking I/O mode.

This function is recorded during a Windows Socket session.

## Return Values

Windows Sockets Return Values

## Parameterization

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

## Example

In the following example, the lrs_send function sends data to a server with an IP address of 199.203.77.246:21.

    lrs_accept_connection("socket4", "socket5");

    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: