like in...
PUT-BYTE(mMsg,1) = iMsgLen1.
PUT-BYTE(mMsg,2) = iMsgLen2.
PUT-STRING(mMsg,3) = MessageToWrite.
but this looks quite strange... why don't you simply use a short (2 byte) or a long (4 byte) for that (don't forget to set the byte-order to 'network' and agree upon that with the 3rd...