You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@mina.apache.org by Jun Dai <wi...@gmail.com> on 2008/12/26 07:50:38 UTC
mina serial communication problem.
Dears,
I'm newbie to mina serail communication.
I wrote two java application hosted in two machines to communicate by serail
port using mina.
One application sent "hello world!" and another application's messagereceive
method worked very strange.
Some times, it can receive "hello world" but some times, the messagereceive
fired only "hello w" and "orld!" will fire by a following messagereceive
fired.
I want to get the "hello world" in one messagereceive so that I can easy
control it.
Can any friend help me?
Thank you!
--
Best Regards
DAI Jun
Re: mina serial communication problem.
Posted by Emmanuel Lécharny <el...@apache.org>.
Jun Dai wrote:
> Dears,
> I'm newbie to mina serail communication.
> I wrote two java application hosted in two machines to communicate by serail
> port using mina.
> One application sent "hello world!" and another application's messagereceive
> method worked very strange.
> Some times, it can receive "hello world" but some times, the messagereceive
> fired only "hello w" and "orld!" will fire by a following messagereceive
> fired.
> I want to get the "hello world" in one messagereceive so that I can easy
> control it.
> Can any friend help me?
>
There is _no_ guarantee that the message will be received in one single
piece. You may perfectly receive each char in one single message, too.
This is up to the server to concatenate the received messages to get the
whole message, so you have to manage some kind of terminator to know
that your message has been fully received.
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org