background image
<< Windows Sockets | Vuser session >>
<< Windows Sockets | Vuser session >>

Using Winsock Data Buffers

Windows Sockets Vuser Scripts · Developing Windows Sockets Vuser Scripts
Creating Vuser Scripts
Chapter 12, page 219
Using Winsock Data Buffers
Several LRS functions, such as lrs_receive and lrs_send, handle the actual data
that is transferred between servers and clients. The data that is received or
transmitted is stored in data buffers, which can be very large. In order to simplify
the appearance of the script, the actual data is stored in external files--not in the
C file. When a data transfer occurs, the data is copied from the external file into a
temporary buffer.
The external file,
data.ws
, contains the contents of all the temporary buffers. The
buffers' contents are stored as sequential records. The records are marked by
identifiers indicating whether the data was sent or received, and the buffer
descriptor. The LRS functions use the buffer descriptors to access the data.
The descriptors have one of the following formats:
recv buf
index number of bytes received
send buf
index
The buffer index begins with 0 (zero), and all subsequent buffers are numbered
sequentially (1,2,3 etc.) regardless of whether or not they are send or receive
buffers.