This commit is contained in:
Looly
2023-03-27 02:02:10 +08:00
parent 16f7549c7d
commit 4fca8310e7
96 changed files with 307 additions and 315 deletions

View File

@@ -54,7 +54,7 @@ public class ChannelUtil {
try {
channel.connect(address).get();
} catch (final InterruptedException | ExecutionException e) {
IoUtil.close(channel);
IoUtil.closeQuietly(channel);
throw new SocketRuntimeException(e);
}
return channel;

View File

@@ -147,7 +147,7 @@ public class AioServer implements Closeable {
*/
@Override
public void close() {
IoUtil.close(this.channel);
IoUtil.closeQuietly(this.channel);
if (null != this.group && false == this.group.isShutdown()) {
try {

View File

@@ -199,7 +199,7 @@ public class AioSession implements Closeable{
*/
@Override
public void close() {
IoUtil.close(this.channel);
IoUtil.closeQuietly(this.channel);
this.readBuffer = null;
this.writeBuffer = null;
}

View File

@@ -161,7 +161,7 @@ public class NioClient implements Closeable {
@Override
public void close() {
IoUtil.close(this.selector);
IoUtil.close(this.channel);
IoUtil.closeQuietly(this.selector);
IoUtil.closeQuietly(this.channel);
}
}

View File

@@ -140,7 +140,7 @@ public class NioServer implements Closeable {
try{
handler.handle(socketChannel);
} catch (final Exception e){
IoUtil.close(socketChannel);
IoUtil.closeQuietly(socketChannel);
log.error(e);
}
}
@@ -148,7 +148,7 @@ public class NioServer implements Closeable {
@Override
public void close() {
IoUtil.close(this.selector);
IoUtil.close(this.serverSocketChannel);
IoUtil.closeQuietly(this.selector);
IoUtil.closeQuietly(this.serverSocketChannel);
}
}

View File

@@ -33,7 +33,7 @@ public class NioServerTest {
doWrite(sc, body);
} else if (readBytes < 0) {
IoUtil.close(sc);
IoUtil.closeQuietly(sc);
}
} catch (final IOException e){
throw new IORuntimeException(e);