mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
add method
This commit is contained in:
parent
0ee4108d26
commit
dd0dd65faf
@ -1,14 +1,14 @@
|
|||||||
package cn.hutool.socket.nio;
|
package cn.hutool.socket.nio;
|
||||||
|
|
||||||
|
import cn.hutool.core.io.IORuntimeException;
|
||||||
|
import cn.hutool.core.io.IoUtil;
|
||||||
|
|
||||||
import java.io.Closeable;
|
import java.io.Closeable;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.nio.channels.SocketChannel;
|
import java.nio.channels.SocketChannel;
|
||||||
|
|
||||||
import cn.hutool.core.io.IORuntimeException;
|
|
||||||
import cn.hutool.core.io.IoUtil;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NIO客户端
|
* NIO客户端
|
||||||
*
|
*
|
||||||
@ -85,6 +85,16 @@ public class NioClient implements Closeable {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取SocketChannel
|
||||||
|
*
|
||||||
|
* @return SocketChannel
|
||||||
|
* @since 5.3.10
|
||||||
|
*/
|
||||||
|
public SocketChannel getChannel() {
|
||||||
|
return this.channel;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
IoUtil.close(this.channel);
|
IoUtil.close(this.channel);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user