This commit is contained in:
Looly 2023-07-26 19:04:42 +08:00
parent 13f2b0839e
commit f35c482b13

View File

@ -2,6 +2,7 @@ package org.dromara.hutool.socket.aio;
import org.dromara.hutool.core.lang.Console;
import org.dromara.hutool.core.text.StrUtil;
import org.dromara.hutool.core.thread.ThreadUtil;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
@ -20,11 +21,7 @@ public class AioClientTest {
}
});
//线程休息1秒然后client server 初始化完再连接
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
ThreadUtil.sleep(1000);
client.write(ByteBuffer.wrap("Hello".getBytes()));
client.read();