mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
fix pr 941
This commit is contained in:
parent
db3d1a1572
commit
3785f0842c
@ -3,7 +3,7 @@
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
## 5.3.9 (2020-06-23)
|
||||
## 5.3.9 (2020-06-28)
|
||||
|
||||
### 新特性
|
||||
* 【core 】 DateUtil增加formatChineseDate(pr#932@Github)
|
||||
@ -12,6 +12,7 @@
|
||||
* 【core 】 修复NumberUtil.partValue有余数问题(issue#I1KX66@Gitee)
|
||||
* 【core 】 修复BeanUtil.isEmpty不能忽略static字段问题(issue#I1KZI6@Gitee)
|
||||
* 【core 】 修复StrUtil.brief长度问题(pr#930@Github)
|
||||
* 【socket 】 修复AioSession构造超时无效问题(pr#941@Github)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
## 5.3.8 (2020-06-16)
|
||||
|
@ -1,5 +1,10 @@
|
||||
package cn.hutool.socket.aio;
|
||||
|
||||
import cn.hutool.core.io.IORuntimeException;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.socket.SocketConfig;
|
||||
import cn.hutool.socket.SocketUtil;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.net.SocketAddress;
|
||||
@ -9,11 +14,6 @@ import java.nio.channels.CompletionHandler;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import cn.hutool.core.io.IORuntimeException;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.socket.SocketConfig;
|
||||
import cn.hutool.socket.SocketUtil;
|
||||
|
||||
/**
|
||||
* AIO会话<br>
|
||||
* 每个客户端对应一个会话对象
|
||||
@ -30,9 +30,9 @@ public class AioSession implements Closeable{
|
||||
private ByteBuffer readBuffer;
|
||||
private ByteBuffer writeBuffer;
|
||||
/** 读取超时时长,小于等于0表示默认 */
|
||||
private long readTimeout;
|
||||
private final long readTimeout;
|
||||
/** 写出超时时长,小于等于0表示默认 */
|
||||
private long writeTimeout;
|
||||
private final long writeTimeout;
|
||||
|
||||
/**
|
||||
* 构造
|
||||
@ -43,11 +43,12 @@ public class AioSession implements Closeable{
|
||||
*/
|
||||
public AioSession(AsynchronousSocketChannel channel, IoAction<ByteBuffer> ioAction, SocketConfig config) {
|
||||
this.channel = channel;
|
||||
this.ioAction = ioAction;
|
||||
|
||||
this.readBuffer = ByteBuffer.allocate(config.getReadBufferSize());
|
||||
this.writeBuffer = ByteBuffer.allocate(config.getWriteBufferSize());
|
||||
this.readTimeout = config.getReadTimeout();
|
||||
this.writeTimeout = config.getWriteTimeout();
|
||||
this.ioAction = ioAction;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user