I tried that, the message is written to the Client. The client is coded in Mina as well (NioConnector); it's messageReceived() gets called as well. When the connector based client responds by writing back into the session the message does not get passed to the acceptor based server; even the encoder's encode() method is not getting called. What am I missing?
Vikram ________________________________ From: Emmanuel Lecharny <[email protected]> To: [email protected] Sent: Tue, June 1, 2010 12:52:26 PM Subject: Re: How to write from Mina-Acceptor based server to a client session? On 6/1/10 8:12 PM, vikram nagpurkar wrote: > I am writing a Mina based Asynchronous server application. For one of the use > cases I need the server to send message(s) to one of the client sessions. How > do I select the client session for a specific client? > do I need to make the IoSession object (for that specific client ) available > to do this or can I use the IoAcceptor object to do this? > You have to keep a track of the <client, session> couple in your server, so that you can do a session.write(). Of course, you can list the sessions managed by the Acceptor.getManagedSessions(), but if you don't have a clue about the session ID, then you are lost (well, you can still iterate through it, but this won't be convenient if you have tens of thousands sessions...) -- Regards, Cordialement, Emmanuel Lécharny www.nextury.com
