mina????????????????
???????????? ???????[ 2013/4/15 10:48:23 ] ????????
??????????β???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);
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11