--
You received this message because you are subscribed to the Google Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com.
To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nodejs?hl=en.
Works pretty well!
Am 18.05.2011 06:10, schrieb Tim Caswell:
> Since you know the size of the message, you can create a new buffer
> object with the total size of the message and set the first 8 bytes
> manually and then write the string into the buffer at the offset, then
> send the buffer to the socket without an encoding.
>
>
> On Tue, May 17, 2011 at 4:25 PM, shimonchayim <shimon...@gmail.com
> <mailto:shimon...@gmail.com>> wrote:
>
> I am trying send binary + Text to an event server over TCP. Sample
> message is like this:
>
> 0x00 0x00 0x00 0x01 0x00 0x00 0x01 0x00 0xd2 [Text Message 210 char
> long]
> (4 bytes counter) (4 bytes message len -> 210 in this case)
>
> Here is the problem, if we use encoding as ASCII with net.socket then
> things like 0x00 get converted to 0x20 (space) and if I use UTF8 then
> 0xd2 shows up something like 0xc3 0x92.
>
> How can I send this event in one socket.write message (i.e. avoid
> changing the encoding)?
>
> If there is a different module that can also be used, I am open.
>
> --
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com
> <mailto:nod...@googlegroups.com>.
> To unsubscribe from this group, send email to
> nodejs+un...@googlegroups.com
> <mailto:nodejs%2Bunsu...@googlegroups.com>.
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com.
> To unsubscribe from this group, send email to
> nodejs+un...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en.
Mit freundlichen Gr��en
--
Stefan Zehe
0951 - 510 908 106
------------------------------
upjers GmbH & Co. KG
Memmelsdorfer Stra�e 250
96052 Bamberg
Sitz der Gesellschaft: Bamberg
Registergericht: Bamberg, HRA 10694
Gesellschafter: Upjers Verwaltungs GmbH
http://www.upjers.com
------------------------------
L.
--
Laurie Harper
http://laurie.holoweb.net/