fixed to close socket while client and server stopping
This commit is contained in:
parent
63689f61e8
commit
1dcf9dec7a
@ -5,7 +5,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group 'me.bvn13'
|
group 'me.bvn13'
|
||||||
version '1.2.1'
|
version '1.2.2'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
@ -90,6 +90,11 @@ public class Client<T extends AbstractClientListener> {
|
|||||||
public void stop() {
|
public void stop() {
|
||||||
log.debug("Stopping client");
|
log.debug("Stopping client");
|
||||||
client.stop();
|
client.stop();
|
||||||
|
try {
|
||||||
|
socket.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error("Failed to close socket");
|
||||||
|
}
|
||||||
executor.shutdown();
|
executor.shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,6 +98,11 @@ public class Server<T extends AbstractClientListener> {
|
|||||||
client.stop();
|
client.stop();
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
socket.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error("Failed to close socket");
|
||||||
|
}
|
||||||
executor.shutdown();
|
executor.shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user