I have a system that I am using winsockets to communicate with. The challenge I have is, before you send anything to it, you have to tell it how many bytes are you going to send as a 4-byte length indicator. Now, how do I send any bytes using lrs_send or any other way? Please help. This is the code I have:-

int rc;

int LenOfUserBuf;
char *hexbuffer_size;
char lengthIndicator[4];


rc = lrs_create_socket("socket1", "TCP", "RemoteHost=<RemoteHost>:<Port>", LrsLastArg);
lrs_receive("socket1", "buf1", LrsLastArg);

lrs_get_static_buffer("socket1", "buf2", 0, -1, NULL);
LenOfUserBuf = lrs_get_user_buffer_size("socket1");

memset(lengthIndicator, '\0', 4);

lengthIndicator[0] = (char)((LenOfUserBuf >> 24) & 0xff);
lengthIndicator[1] = (char)((LenOfUserBuf >> 16) & 0xff);
lengthIndicator[2] = (char)((LenOfUserBuf >> 8) & 0xff);
lengthIndicator[3] = (char)(LenOfUserBuf & 0xff);

How can I send "lengthIndicator" using lrs_send or any other method?