This commit is contained in:
Looly
2019-10-29 19:05:23 +08:00
parent 3cef7fa9a7
commit bf03aebcef
107 changed files with 283 additions and 456 deletions

View File

@@ -22,7 +22,7 @@ import cn.hutool.socket.SocketRuntimeException;
*/
public class AioClient implements Closeable{
private AioSession session;
private final AioSession session;
/**
* 构造

View File

@@ -23,12 +23,12 @@ import cn.hutool.socket.SocketConfig;
*/
public class AioServer implements Closeable {
private static final Log log = LogFactory.get();
private static AcceptHandler ACCEPT_HANDLER = new AcceptHandler();
private static final AcceptHandler ACCEPT_HANDLER = new AcceptHandler();
private AsynchronousChannelGroup group;
private AsynchronousServerSocketChannel channel;
protected IoAction<ByteBuffer> ioAction;
protected SocketConfig config;
protected final SocketConfig config;
/**

View File

@@ -25,8 +25,8 @@ public class AioSession implements Closeable{
private static final ReadHandler READ_HANDLER = new ReadHandler();
private AsynchronousSocketChannel channel;
private IoAction<ByteBuffer> ioAction;
private final AsynchronousSocketChannel channel;
private final IoAction<ByteBuffer> ioAction;
private ByteBuffer readBuffer;
private ByteBuffer writeBuffer;
/** 读取超时时长小于等于0表示默认 */