You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Trustin Lee <tr...@gmail.com> on 2007/09/28 17:01:15 UTC

Re: problem the communication to cross-platform(flash)..

Please take a look at this thread:

http://www.nabble.com/sending-null-terminated-strings-tf4410525s16868.html

Trustin

On 8/14/07, leecholho <ro...@hotmail.com> wrote:
>
> thanks your replay..
> i checked a messages with Ethereal..
> and cheked that flash sent "0d 0a 00"
>
> i'm testing a several methods..
> 1) session.write("<head>LOGINS</head>");
>     last message is "0a" , flash is not  checked  get message..
> 2) session.write("<head>LOGINS</head>\r");
>     last message is "0d0a" , flash is not  checked  get message..
> 3)session.write("<head>LOGINS</head>\r\n");
>     last message is "0d0a0a" , flash is not  checked  get message..
> 4)session.write("<head>LOGINS</head>\0");
>     last message is "000a" , flash is checked  get message but java received
> empty message.
> 5)session.write("<head>LOGINS</head>\r\n\0");
>     last message is "0d0a000a" , flash is checked  get message but java
> received empty message.
>
>
>  i forgot the explain the before source , i used  out.flush();
> out = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
>
>
>
> Trustin Lee wrote:
> >
> > On 8/14/07, leecholho <ro...@hotmail.com> wrote:
> >>
> >> hi..
> >> i'm testing a modified source of sample chat server source.. client
> >> program
> >> is flash,
> >>
> >> flash transmitted message that added "\r\n" to the message.
> >> and java server(multi-thread base) is return message that added "\0" to
> >> the
> >> return message.
> >>
> >> i used same source the recevie and send part. first message is not
> >> problem.
> >> server is recevied and return ok message the client, and client is
> >> recevied
> >> ok message. but client next message is sent to server, server received
> >> empty
> >> message.
> >>
> >> what is problem?
> >> [ client source ]
> >> function handleIncoming (messageObj) {
> >>         var tag=messageObj.firstChild.firstChild.nodeValue;
> >>         if(tag == "LOGINS"){
> >>                 mySocket.send("PN\r\n");
> >>         }
> >> }
> >> mySocket.connected = true;
> >> mySocket.send("LOGIN"+"\t"+userid+"\r\n");
> >> [ /client source]
> >
> > Doesn't the client send a trailing '\0' after \r\n?  Please try to use
> > a packet analyzer such as Wireshark to see what client is exactly
> > sending.  If the client is sending a NUL character, you can get an
> > empty string.  Please let me know what the client is sending, so I can
> > help you track down the problem.
> >
> > HTH,
> > Trustin
> > --
> > what we call human nature is actually human habit
> > --
> > http://gleamynode.net/
> > --
> > PGP Key ID: 0x0255ECA6
> >
> >
>
> --
> View this message in context: http://www.nabble.com/problem-the-communication-to-cross-platform%28flash%29..-tf4264788s16868.html#a12139898
> Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.
>
>


-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6