mina????????????????
???????????? ???????[ 2013/4/15 10:48:23 ] ????????
?????????????????????????????mina???д????????????mina2.0?????????????mina?????????????????
???????mina????
????????????Apache??Mina??Multipurpose Infrastructure Networked Applications???????????????????????????????????????????????????ó?????????????????????????????API???Java NIO????????Э?饗??TCP/IP??UDP/IPЭ??????????Ч??????
?????????????http://mina.apache.org/
????????????http://my.oschina.net/ielts0909/blog/90355/
????????mina?????????
??????????????????mina????????????????????????????????????IoProcessor??????????????????????????????????????IoSession?????IoFilter???????????????IoHandler?????????????????
???????????????
????1??IoService
????IoService???????????????????????????????????????????????
??????????????????????
try {
acceptor = new NioSocketAcceptor();\????????????
acceptor.getFilterChain().addLast( "codec"?? new ProtocolCodecFilter(new TextLineCodecFactory(Charset.forName("UTF-8")?? LineDelimiter.WINDOWS.getValue()?? LineDelimiter.WINDOWS.getValue()))); \???????????
acceptor.getFilterChain().addLast("logger"??new LoggingFilter()); \??????????????
acceptor.getSessionConfig().setReadBufferSize(2048);\?????????????С
acceptor.getSessionConfig().setIdleTime(IdleStatus.BOTH_IDLE?? 10);\?????д???н??????
acceptor.setHandler(new IoHandlerAdapter());\???????????
acceptor.bind(new InetSocketAddress(port));\?????
logger.info("???????????... ???????" + port);
} catch (Exception e) {
logger.error("??????????...."?? e);
e.printStackTrace();
}
?????????????????????????????????????Java NIO??????socket???????????
????2??IoProcessor
???????????IoAcceptor??IoConnector????????IoProcessor???????IO?????????IoProcessor????IoProcessor???????????IoProcessor??????С??????????CPU????+1??????????????IoProcessor???????С????3????????ExecutorFilter????????????????IoProcessor??????IoSession
????acceptor.getFilterChain().addLast("threadpool"??new ExecutorFilter(corePoolSize?? maximumPoolSize?? keepAliveTime??unit)
??????
???·???
??????????????????
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