X-Git-Url: https://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Futils%2Fserial%2Fserver%2FServerObject.java;h=6d3d53935208d713ef251d3ec8bf7b5ce54c85bf;hb=a72ea8a7a30837734f7f3f27a4ec7979d2549043;hp=67dfa4a020d3a0cb8f8a70446298ddb7e0b0f7ee;hpb=0ff71477abf90d4843b8d9a3dc9907b5edc95fc0;p=nikiroo-utils.git diff --git a/src/be/nikiroo/utils/serial/server/ServerObject.java b/src/be/nikiroo/utils/serial/server/ServerObject.java index 67dfa4a..6d3d539 100644 --- a/src/be/nikiroo/utils/serial/server/ServerObject.java +++ b/src/be/nikiroo/utils/serial/server/ServerObject.java @@ -2,6 +2,7 @@ package be.nikiroo.utils.serial.server; import java.io.IOException; import java.net.Socket; +import java.net.UnknownHostException; import be.nikiroo.utils.Version; @@ -28,6 +29,11 @@ abstract public class ServerObject extends Server { * * @throws IOException * in case of I/O error + * @throws UnknownHostException + * if the IP address of the host could not be determined + * @throws IllegalArgumentException + * if the port parameter is outside the specified range of valid + * port values, which is between 0 and 65535, inclusive */ public ServerObject(int port, boolean ssl) throws IOException { super(port, ssl); @@ -46,6 +52,11 @@ abstract public class ServerObject extends Server { * * @throws IOException * in case of I/O error + * @throws UnknownHostException + * if the IP address of the host could not be determined + * @throws IllegalArgumentException + * if the port parameter is outside the specified range of valid + * port values, which is between 0 and 65535, inclusive */ public ServerObject(String name, int port, boolean ssl) throws IOException { super(name, port, ssl); @@ -61,6 +72,9 @@ abstract public class ServerObject extends Server { Object rep = null; try { rep = onRequest(this, clientVersion, data); + if (isClosing()) { + return; + } } catch (Exception e) { onError(e); } @@ -73,7 +87,7 @@ abstract public class ServerObject extends Server { @Override protected void onError(Exception e) { - getTraceHandler().error(e); + ServerObject.this.onError(e); } }; }