Mina使用IoHandler实现业务处理
IoHandler 是 Mina 实现其业务逻辑的顶级接口;在 IoHandler 中定义了 7 个方法,根据 I/O 事件来触发对应的方法: import java.io.IOException; public interface IoHandler { void sessionCreated(IoSession session) throws Exception; void sessionOpened(IoSession session) throws Exception; void sessionClosed(IoSession session) throws Exception; void sessionIdle(IoSession session, IdleStatus status) throws Exception; void exceptionCaught(IoSession session, Throwable cause) throws Exception; void messageReceived(IoSession session, Object message) throws Exception; void messageSent(IoSession session, Object message) throws Exception; }