fixed to close socket while client and server stopping

master
bvn13 2022-02-17 23:21:41 +03:00
parent 63689f61e8
commit 1dcf9dec7a
3 changed files with 11 additions and 1 deletions

View File

@ -5,7 +5,7 @@ plugins {
}
group 'me.bvn13'
version '1.2.1'
version '1.2.2'
repositories {
mavenCentral()

View File

@ -90,6 +90,11 @@ public class Client<T extends AbstractClientListener> {
public void stop() {
log.debug("Stopping client");
client.stop();
try {
socket.close();
} catch (IOException e) {
log.error("Failed to close socket");
}
executor.shutdown();
}

View File

@ -98,6 +98,11 @@ public class Server<T extends AbstractClientListener> {
client.stop();
iterator.remove();
}
try {
socket.close();
} catch (IOException e) {
log.error("Failed to close socket");
}
executor.shutdown();
}