Hello Surabaya, if you send binary with LineMode there are many way to manage it.
The simplest : use BASE64 e-mail attachement style that is nice as designed to work ascii lined mode but increase size of data about +40% (as all binary e-mail attachements do by the way). You could also send binary but then you should take care to backslash all delimiter characters/bytes. You can also temporary switch between lined mode and binary mode : if line mode ON and receive string "bin 1223435" then LineMode OFF and receive data until size = 1223435 then LineMode ON again. Regards. S> On 2/19/06, Francois PIETTE <[EMAIL PROTECTED]> wrote: >> >> > Ok, then I must manage the received buffer by myself? >> > cutting and joining so that it can be interpreted perfectly by the >> > receiver, >> > is that right? >> >> Yes and no :-) >> TWSocket has a "line mode" in which it assemble (or split) packets for >> you. >> You specify a delimiter (default to #13#10 but can be anything), tunr line >> mode on and then you get OnDataAvailable triggered only when one complete >> line (well anything terminated by your delimiter) has been received. If a >> line is split in several packets, or a single packet contain several >> lines, >> TWSocket will always trigger exactly one OnDataAvailable per line >> received. S> Nah, this is what I need.... how long can the delimiter be? can it be 5 S> characters? S> If you don't use line mode, then you must design your protocol the way you >> like. Basically, your receiver has to know what the sender is sending ! If >> not using a delimiter (line mode), then you either have to send fixed >> length >> record, or send somewhere the length or the type of your record (probably >> at >> the start of the record). S> It will be much better I can use the line mode... S> I'm going to send binary data, using 5 characters delimiter... is it safe? S> Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html >> -- >> [EMAIL PROTECTED] >> http://www.overbyte.be >> >> >> -- >> 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 >> -- 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