???????Java?????????
???????????? ???????[ 2015/5/14 14:12:17 ] ????????????????
?????????????
??????????????????????????????????????????????????????
???????????????????????????????????????
????????????????????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();
??????
???·???
??????????????????
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