diff --git a/rirud/src/main/java/riru/DaemonSocketServerThread.java b/rirud/src/main/java/riru/DaemonSocketServerThread.java index d590c0b5..736263e3 100644 --- a/rirud/src/main/java/riru/DaemonSocketServerThread.java +++ b/rirud/src/main/java/riru/DaemonSocketServerThread.java @@ -20,6 +20,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; +import java.net.SocketException; import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.Collections; @@ -349,6 +350,7 @@ private void startServer() throws IOException { socket = serverSocket.accept(); } catch (IOException e) { if ((e.getCause() != null && e.getCause() instanceof ErrnoException && ((ErrnoException) e.getCause()).errno == EINVAL) || + e instanceof SocketException || (e.getMessage() != null && (e.getMessage().contains("EINVAL") || e.getMessage().contains(String.format(Locale.ROOT, "errno %d", EINVAL))))) { Log.i(TAG, "Server shutdown."); return;