mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
commit
090b2e1706
@ -14,7 +14,7 @@ public class AioClientTest {
|
||||
public static void main(String[] args) throws IOException {
|
||||
final AsynchronousChannelGroup GROUP = AsynchronousChannelGroup.withFixedThreadPool(//
|
||||
RuntimeUtil.getProcessorCount(), // 默认线程池大小
|
||||
ThreadFactoryBuilder.create().setNamePrefix("Huool-socket-").build()//
|
||||
ThreadFactoryBuilder.create().setNamePrefix("Hutool-socket-").build()//
|
||||
);
|
||||
|
||||
AioClient client = new AioClient(new InetSocketAddress("localhost", 8899), new SimpleIoAction() {
|
||||
|
@ -23,7 +23,7 @@ public class NioServerTest {
|
||||
// Flips this buffer. The limit is set to the current position and then
|
||||
// the position is set to zero,就是表示要从起始位置开始读取数据
|
||||
readBuffer.flip();
|
||||
//eturns the number of elements between the current position and the limit.
|
||||
// returns the number of elements between the current position and the limit.
|
||||
// 要读取的字节长度
|
||||
byte[] bytes = new byte[readBuffer.remaining()];
|
||||
// 将缓冲区的数据读到bytes数组
|
||||
|
Loading…
x
Reference in New Issue
Block a user