> Starting from various TCP client inlcuded in ICS examples, I tried to
> send through TWSocket a mix of text commands and records but I wasn't
> On the server, I receive correctly the text command but not the
> record. What I'm doing wrong?
You would need to be listening with LineMode = false to receive such
mixed packets, but you don't really know how long to listen since there
is no length sent anywhere.
You should really devise a simple protocol that means you know how much
data you are sending, and therefore how much to receive.
The simplest improvement in your example would be work out the total
length of string and record, send that length first, followed by a short
string with length byte, then the binary record. Or just move the
string into the record (as ShortString). You then know exactly how much
data is being received, and can wait for as many packets as it takes.
It will not necessarily arrive in a single packet.
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be