Example: lrs_length_send

In the following example, the buffer buf6 is sent on socket0. The data to be sent is parameterized. "NameParameter" is a parameter taken from a list of first names.

The length field specified by the left and right boundaries falls between the colons - it initially has the value 4.

Example: buf6:
"Start Data LBoundary & Offset:4:RBoundary<NameParameter>"

However, as the name in "NameParameter" changes, Vugen inserts a different length in this field. In the first iteration, the name "David" is taken from the parameter list. Vugen inserts 5 (see below "SENT BUFFER on first iteration"), being the length of the word "David".

In the next invocation of lrs_length_send, the data has changed to the name "Michael". The length field is modified to 7 (see below "SENT BUFFER on second iteration").

#include "lrs.h"

Action() {

     lrs_create_socket("socket0", "TCP",
               "RemoteHost=bonaparte.mercury.co.il:7", LrsLastArg);

     lrs_length_send("socket0", "buf6", LeftRightBoundaries, "LB=LBoundary",
               "RB=:RBoundary", "Offset=10", LrsLastArg);

     lrs_close_socket("socket0");

     return 0;
}

Example: ===SENT BUFFER (on first iteration) ===
"Start Data LBoundary & Offset:5:RBoundaryDavid"

Example: ===SENT BUFFER (on second iteration) ===
"Start Data LBoundary & Offset:7:RBoundaryMichael"