socket(Channel)协议编码

来源:互联网 发布:steam怎么公开数据 编辑:程序博客网 时间:2024/06/10 11:50

不需要额外的Jar包
服务端代码:
public class NIOSServer
{
private int port=0;
private Charset cs=Charset.forName(CommonConstant.CHARSET);
private static ByteBuffer sBuffer=ByteBuffer.allocate(CommonConstant.BUFFER_SIZE);
private static ByteBuffer rBuffer=ByteBuffer.allocate(CommonConstant.BUFFER_SIZE);
/保存客户端的channel/
private Map

0 0