??????????β???mina??????

????1???????????mina?????

public IoConnector creatClient() {
  NioSocketConnector connector = null;
  try {
   connector = new NioSocketConnector();
   connector.getSessionConfig().setReadBufferSize(1024 * 1024 * 5);
   connector.getSessionConfig().setBothIdleTime(10);
   connector.getSessionConfig().setKeepAlive(true);
   connector.setHandler(new MyIoHandler());
   connector.getFilterChain().addLast("codec"??
     new ProtocolCodecFilter(new DecodeFactory()));
   connector.setConnectTimeoutMillis(5000);
  } catch (Exception e) {
   e.printStackTrace();
  }
  return connector;
 }

????2????дHanlder???????????messageReciever?????????д????δ??????????????????????

@Override
 public void sessionCreated(IoSession session) throws Exception {
  logger.info("??????????????????...");
 }
 @Override
 public void sessionOpened(IoSession session) throws Exception {
  logger.info("????????????????..."+ "?????" + session.getId() + "???????");
 }
 @Override
 public void messageReceived(IoSession session?? Object message)
   throws Exception {
  if (message instanceof IoBuffer) {  
   ServerResponse.getResponseInfo(session??(IoBuffer)message);
  }
 }
 @Override
 public void messageSent(IoSession session?? Object message) throws Exception {
  logger.info("??????????????...");
 }
 @Override
 public void sessionClosed(IoSession session) throws Exception {
  logger.info("?????????????????...");
 }

 @Override
 public void sessionIdle(IoSession session?? IdleStatus status)
   throws Exception {
  logger.info("?????????????..."); 
 }
 @Override
 public void exceptionCaught(IoSession session?? Throwable cause)
   throws Exception {
  logger.error("??????????..."?? cause);
 }