FP> No need to loop beause ReceiveStr() will receive the complete line received FP> so far and if more lines are available, then more OnDataAvailable events
FP> will be triggered.

yes,  I  forgot  that when using line mode the OnDataAvailable is only
triggered when an entire SINGLE line has been received.

TWSocket is very smart, it handle all cases:
- One single line received in an incomming packet
- One partial line received in an incomming packet
- Several lines received in a single packet, including the end of a previously uncomplete line and the start of a next line not complete yet. In all cases, you receive exactly one OnDataAvailable per complete line and if many lines are available, you receive as much OnDataAvailable as needed. If the socket is closed while a partial line is received, you get an OnDataAvailable event at tha time. There is also a property LineLimit which you should use to avoid malicious code sending huge line which would be buffered by TWSocket. With LineLimit, TWSocket will stop buffering once the limit is reached and trigger an OnLineLimitExceeded event to allow you to handle that case nicely.

--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be


--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to