Michel,
Sometimes when debugging white space characters such as
carriage
return and new line are represented by \r and \n respectively.
This is because otherwise you really wouldn't know they're there, but they are
coming in from the binary. In hex I believe carriage
return
(\r) is 0x0D and new line (\n) is 0x0A. So you should be able
to send them using writeByte(0x0D) and writeByte(0x0A). You can double check
for the correct hex by calling toString(16) on the \r and \n bytes coming in.
You may already be doing this correctly, I just couldn't tell for sure from the
posting.
Ben Stucki
-------------------------------
We're Hiring! Seeking a passionate developer to join our team building Flex
based products. Position is in the Washington D.C.
metro area. If interested contact [EMAIL PROTECTED]
----------------------------------------
From: "Michel Scoz" <[EMAIL PROTECTED]>
Sent: Friday, February 23, 2007 5:48 AM
To: [email protected]
Subject: [flexcoders] Flex Socket + MSN Protocol
Hi all...
I've been reading and searching the archives about
sockets but found nothing that would "solve" my problem, so i was wondering if
anyone could give me a light =)
Currently I'm tryin to connect a Flex Project using
Sockets to a MSN server using MSN Protocol Version 13.
The problem im runnin into is that the protocol
always ends with an "\r\n" to finish a command, pretty much like
this:
">>>" stands for send
commands
"<<<" stands for received
commands
>>> VER 1 MSNP13 CVR0\r\n
<<< VER 1 MSNP13 CVR0\r\n
>>> CVR 5 0x0409 winnt 5.1 i386 MSG80BETA
8.0.0566 msmsgs [EMAIL PROTECTED]
<<< CVR 5 8.0.0566 8.0.0566 8.0.0566
http://msgr.dlservice.microsoft.com/download/4/5/b/45beb06f-5a08-4694-abd8-d6e706b06b68/Install_Messenger_Beta.exehttp://ideas.live.com\r\n
>>> USR 6 TWN I [EMAIL PROTECTED]
<<< USR 6 TWN S
lc=1033,id=507,tw=40,fs=1,ru=http%3A%2F%2Fmessenger%2Emsn%2Ecom,ct=1062764229,kpp=1,kv=5,ver=2.1.0173.1,tpf=43f8a4c8ed940c04e3740be46c4d1619\r\n
See? Every command line end with an "\r\n" but I
dont know how to replicate this using Flex.
The Socket class when i send "\r\n" always finishes
the send command givin me and EOF (end of file error) in a window executing the
app.
And the XMLSocket commands are always terminated by
a zero (0) byte.
So, can someone give me some directions on how to
do it?
I was able to do it with PHP with ease as I was
only sending strings... how to do it with Flex? Any help ppl?
Thanks in advance,
Michel.