X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Futils%2Fserial%2Fserver%2FServerString.java;h=89a7b28c6042418be95348191ad79794adb826fe;hb=52e0732e1f06ddff5d69c0588bdbd937fcc52537;hp=186afa07ed6d2c85f94e7e2db1d7f5dfd601efc5;hpb=8537d55a7dacf9f528ea9453b03d2391ea348846;p=nikiroo-utils.git diff --git a/src/be/nikiroo/utils/serial/server/ServerString.java b/src/be/nikiroo/utils/serial/server/ServerString.java index 186afa0..89a7b28 100644 --- a/src/be/nikiroo/utils/serial/server/ServerString.java +++ b/src/be/nikiroo/utils/serial/server/ServerString.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 ServerString 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 ServerString(int port, boolean ssl) throws IOException { super(port, ssl); @@ -46,6 +52,11 @@ abstract public class ServerString 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 ServerString(String name, int port, boolean ssl) throws IOException { super(name, port, ssl); @@ -60,6 +71,9 @@ abstract public class ServerString extends Server { String rep = null; try { rep = onRequest(this, clientVersion, data); + if (isClosing()) { + return; + } } catch (Exception e) { onError(e); } @@ -71,6 +85,11 @@ abstract public class ServerString extends Server { send(rep); } } + + @Override + protected void onError(Exception e) { + ServerString.this.onError(e); + } }; }