Muhammad Ichsan a écrit :
On Wed, Feb 3, 2010 at 7:31 PM, Emmanuel LŽcharny <[email protected]> wrote:
Muhammad Ichsan a écrit :
Dear All,

I'm using Mina 2 with TextLineCodeFactory as the protocol codec. As
                                     ^^^^^^^^^^^^^^^^^^^^^^^^
Simply add a '\n' at the end of each message. The codec you are using
(Text*Line*Codec) is expeciting to see *lines*, not messages.
Sorry, I missed this line i your code.

Now, if you are trying to send a message in the sessionOpened() event, it won't work.

Just move the code outside of this event, it will work perfectly. Something like :

...
       ConnectFuture cf = trying.createClient().connect(address);
cf.awaitUninterruptibly(); // Send many messages
       for (int i = 0; i < 20; i++) {
...

produces :

--0
Got from client: Client.message.0
--1
Got from client: Client.message.1
--2
...

Reply via email to