Hi, > But i don't know when the result message is done. I use I don't know what you meant when saying "when the result message is done"? MINA just helps us to transfer the message. And you have to customize and handle the processing logic of the system yourself. Please give me more detail or something related. Hope I could help you guy.
Thanks & best regards, Hieu Phan. > -----Original Message----- > From: sishen [mailto:[EMAIL PROTECTED] > Sent: Wednesday, November 01, 2006 4:26 PM > To: mina-dev@directory.apache.org > Subject: How to get the received message object? > > public class ResultMessageHandler implements MessageHandler { > public void messageReceived(IoSession session, Object message) throws > Exception { > ResultMessage result = (ResultMessage)message; > System.out.println("Message Received: ResultMessage"); > } > } > > when i received the ResultMessage, i need to save it. > > Now i use > session.setAttribute("result", result); > And in the client, > ResultMessage result = (ResultMessage)session.getAttribute("result"); > > But i don't know when the result message is done. I use > while (!session.containsAttribute("result")) > ; > ResultMessage result = (ResultMessage)session.getAttribute("result"); > > But this has an problem, which is that when the server met an mistake, it > will block forever. I do not prefer this way. > > > I want to know whether there is a way to solve this problem. I want to > return the message the server sent to me. > > thx~