Hello,

I am in front of a strange behavior and would like to know if it is
because of a misuse or a bug (using ICS V8 WSocket)

I am inside a TWebSocket.OnDataAvailable with LineEnd set to CRLF
(two chars).

I  received  a  data packet containing many lines, the first lines are
standard  CRLF  lines  and  then  there is no more CRLF separator "{}"
blocks so I decided to switch LineEnd for a "}" single char.

Example of buffer :

Line1$0D$0A
Line2$0D$0A
Line3$0D$0A
{hello1 1234567}{hello2 1234567}{hello3 1234567}

In  this  example  I  let  OnDataAvailable  trigger 3 times then I set
LineEnd to '}'.

The  next OnDataAvailable will trigger fine but will retrieve an extra
char  from  the  last  char  of  previous  buffer, then next lines are
retrieved fine, no more extra char :

"Line1$0D$0A"
"Line2$0D$0A"
"Line3$0D$0A"
"$0A{hello1 1234567}"
"{hello2 1234567}"
"{hello3 1234567}"

In  this  example  the "}" lines ended also with a "7" so I decided to
change  LineEnd  to  "7}"  (same char length as a CRLF) that fixed the
problem,  no  more extra char in the first new LineEnd (by curiosity I
tried  to set a larger LineEnd "67}" but it worked fine so the problem
seems to appear only if LineEnd is changed to shorter char length.

regards.

-- 
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