On 10/01/2009 08:15 PM, Mark Wallsgrove wrote:
Hey :)
I am using Mina for a social networking client (MSN, ICQ, IRC, AOL,
etc). Currently I have got to the stage where I need to be able to
disconnect from the current connection and reconnect to a new host
(Redirection from switchboard). How is this possible from the
IoHandleAdaptor? Surely this should be rather simple?
I am currently using Mina 1.1.7.
Thank you for any replies
Not sure I understand the problem. If you want the server to disconnect
the connection, you'd do it like so:
public class YourHandler extends IoHandlerAdapter {
public void messageReceived(IoSession session, Object message) throws
Exception {
String messageStr = message.toString();
if (messageStr.equals("disconnect")) {
session.close();
}
}
}
Is there more to what you're trying to do than that?
DR