Hi there, I believe that every time a connection is built, there's a session being created with it. So per-connection based protocol is really just a special case of per-session protocol. If you don't expect the server to send you any response, you may do something like <code> WriteFuture wf = session.write(Message msg); wf.join(); CloseFuture cf = session.close(); cf.join(); </code> to close the session and connection after you finish sending you message. Alternatively, You can add a IoFutureListener, which will be notified once a IoFuture's status is changed, to close the session.
If you do expect the server to send some response message, you can do the same thing in the IoHandler you give to your IoConnector. In which case, you would have to use IoFutureListener in order to avoid deadlock. Cheers, Qi scottmiller wrote: > > I saw this in another posting: > > "And, if your client sends messages asynchronously (i.e. sends requests > before all previous responses are received.), any incoming messages > will be buffered in the internal queue until your messageReceived() > method returns. The queue is maintained on a per-session basis, so > any other sessions won't be affected when one session's > messageReceived() runs long." > > Are there plans in an upcoming MINA release to support asynchronous > messaging on a per-connection basis? Any known workarounds? > > -- View this message in context: http://www.nabble.com/support-for-asyncrhonous-messaging-on-a-per-connection-basis-tp14463996s16868p14475983.html Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.
