If you data has a terminating character then you can use lineMode. Then
OnDataAvailable will only fire when thes character(s) are received and
you have all your data at ones.
If not it will arrive in many chunck, or datapackets can even be
concatenatied. Thats nature of TCP.
> Now, I'm using CliSocket.ReceiveStr to recieve data and put this
> in a buffer until all data is read
That is the right way to do if you dont have terminating characters.
Better is to use Receive, then you save an extra copy to a string.
Rgds, Wilfried [TeamICS]
Wednesday, October 19, 2005, 10:18, Werner wrote:
> Does twSocket has a method to use streams
> I want to recieve some data in a TStringStream
> Now, I'm using CliSocket.ReceiveStr to recieve data and put this in a buffer
> until all data is read
> I wonder if I can read all data in one piece by using streams?
> Thanks for any suggestions
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