lrs_set_send_buffer

Buffer Functions

Specifies the buffer to send.

int lrs_set_send_buffer( char *s_desc, char *buffer, int size );
s_desc A descriptor identifying a socket.
buffer A pointer to the buffer containing the data to be sent.
size The size of the data to send in bytes.

The lrs_set_send_buffer function specifies the buffer to send in the next call to lrs_send. The buffer specified in lrs_set_send_buffer is sent, and not the buffer designated in the lrs_send function.

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

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_set_send_buffer function sets the buffer containing the data for socket2. Note that 10 bytes from Buffer are sent on the socket, and not the buffer referenced by "buf21".

/* Set the buffer value. */
char *Buffer;
int Size;
lrs_receive("socket2", "buf20", LrsLastArg); 
lrs_get_last_received_buffer("socket2", &Buffer, &Size);
/* Make modifications on the last received buffer. */ 
. . .
lrs_set_send_buffer("socket2", Buffer, 10 );
lrs_send("socket2","buf21", LrsLastArg );
lrs_free_buffer(Buffer);