mina-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Muhammad Ichsan <ich...@gmail.com>
Subject Re: Which session?
Date Mon, 03 Jan 2011 08:55:57 GMT
On Mon, Jan 3, 2011 at 3:27 PM, Emmanuel Lecharny <elecharny@gmail.com> wrote:
> On 1/3/11 8:35 AM, Muhammad Ichsan wrote:
> So if you want to write some message in a session, do it in your application
> implementing the IoHandler interface. The good candidate will be to do that
> in the messageReceived( IoSession session, Object message) event, where the
> session is present.

But, this messageReceived( IoSession session, Object message)  won't
be called on acceptor's IoHandler unless it's clients send a message
first. In my case, clients doesn't send first message. They just
respond to what server sends. I thought I could use session inside
sessionOpened(IoSession session) in acceptor once a client has
connected to server.

The real case could be a chat server and client system. But, instead
of socket connector send the first message to server, it is server
that send the first hello message to a client. The client, never sends
any message unless the server sends hello.

~The best men are men who benefit to others
http://michsan.web.id 一緒に勉強しましょう!

Yang berkualitas memang beda rasanya!

View raw message