?????????????
??????????????????????????????????????????????????????
???????????????????????????????????????
????????????????????java?????????????
????1.?????????????????鲿????
????2.?????????????????????飬???????
????3.?洢????
???????????????????????????С????????Χ??
???????·????????嶨?????
????????????????????????????????????飬??????飬????????
???????????????????в?????????????????????????????飬??????? ??
??????????
?????????????????????????????????????????????????1?????飺?????饗??????????
?????????饗??????????????????饗??????????????????饗?????з??????????
?????????饗?????????? ???
??????????????????????

????????????
????1?? ??????????黯?????????????????????????飬???????????
?????????????????齫????????????????????????????????????????
????????????????????????????????????
????2?? ??????????????ù??????????????????????????????????????
????3?? ??????????????????????????????????
????4?? ??????????????????????
??????????????
?????????????????????????
????????1??????socket??????
????????2??????socket????????????
????????3??????socket???????????
????tcp????????????
???????壺
???????????http???????????socket????????????ο?????????????????????
???????????socket???????????????????????????????????????????????????μ????? ??
????????????£?


????io?????mina???
????????????????
NioSocketConnector connector = new NioSocketConnector();
connector.setConnectTimeoutMillis(CONNECT_TIMEOUT);
//????????壬????????????С??????
connector.getSessionConfig().setReadBufferSize(2048*2048);
//????????????
connector.getFilterChain().addLast("codec"??
new ProtocolCodecFilter(new ObjectSerializationCodecFactory()));
//?????????????
connector.getFilterChain().addLast("logger"?? new LoggingFilter());
//????Handler
connector.setHandler(new MyClientHandler());
//?????????÷?????????
ConnectFuture future = connector.connect(new InetSocketAddress(
HOSTNAME?? PORT));
//??????????
future.awaitUninterruptibly();
//???session
IoSession session = future.getSession();
//???session???
session.getCloseFuture().awaitUninterruptibly();
//???connector
connector.dispose();