Alternatively you start a timer with short interval (100 ms) when you receive data, reset the timer each time you receive data and keep adding the data to a buffer. Once the timer triggers you can assume you have all data. This way it keeps working of the XML layout changes :)


On 9-10-2013 09:26, Graham Powell wrote:
The data is enclosed with a standard tag format. In this case it is
<mos>.....</mos>, so I know when I have received a complete message
The message may or may not include carriage returns or line feeds. These
would be removed anyway as they have no meaning within the message.


-----Original Message-----
From: TWSocket [] On Behalf Of
François Piette
Sent: 08 October 2013 19:57
To: 'ICS support mailing'
Subject: Re: [twsocket] Delphi TServerSocket vs ICS equivalent

How the messages are sent to me is out of my control. But the client
not send me another
message until the previous one has been acknowledged. If I don't
at all the client will
timeout, close the socket connection, re-open it and send the original
message again.

If your XML message has no delimiter, then you must parse it on the fly -
which is possible - so that you know when it is complete and time to process

This is a perfectly usable strategy but this is not what is usually done.
Usually, either there is a delimiter at the end of the data, or there is a
length expressed in front of data. The receiver then knows when everything
has been received without any knowledge - beside length or delimiter - of
the "message" content. This helps building a layered application where
transport and processing is clearly distinguished.

Of course those considerations are not dependent on the component used. What
you use with the old component is for sure good for ICS component as well.

Embarcadero MVP

To unsubscribe or change your settings for TWSocket mailing list
please goto
Visit our website at

Reply via email to