Compare commits

..

6 Commits

3 changed files with 14 additions and 5 deletions

View File

@@ -7,7 +7,7 @@
</parent> </parent>
<groupId>net.bigeon.gclc</groupId> <groupId>net.bigeon.gclc</groupId>
<artifactId>socket</artifactId> <artifactId>socket</artifactId>
<version>1.1.15-SNAPSHOT</version> <version>1.1.16</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>GCLC Socket</name> <name>GCLC Socket</name>
<description>Socket implementation of GCLC</description> <description>Socket implementation of GCLC</description>
@@ -36,7 +36,7 @@
</developers> </developers>
<scm> <scm>
<developerConnection>scm:git:gogs@git.code.bigeon.net:emmanuel/gclc.git</developerConnection> <developerConnection>scm:git:gogs@git.code.bigeon.net:emmanuel/gclc.git</developerConnection>
<tag>HEAD</tag> <tag>socket-1.1.16</tag>
</scm> </scm>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

View File

@@ -41,6 +41,7 @@ import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.InterruptedIOException;
import java.io.PrintStream; import java.io.PrintStream;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.function.Supplier; import java.util.function.Supplier;
@@ -119,6 +120,7 @@ public final class PluggableConsoleInput implements ConsoleInput {
if (prompting) { if (prompting) {
// print the hint, to indicate we are waiting for a user input. // print the hint, to indicate we are waiting for a user input.
out.print(hint); out.print(hint);
out.println();
out.flush(); out.flush();
} }
final InputStreamReader streamReader = new InputStreamReader(stream, final InputStreamReader streamReader = new InputStreamReader(stream,
@@ -279,7 +281,14 @@ public final class PluggableConsoleInput implements ConsoleInput {
final long connexionTimeout) throws IOException, InterruptedException { final long connexionTimeout) throws IOException, InterruptedException {
synchronized (connexionLock) { synchronized (connexionLock) {
if (connected) { if (connected) {
return connexion.getNextMessage(messageTimeout); try {
return connexion.getNextMessage(messageTimeout);
} catch (final InterruptedIOException e) {
throw e;
} catch (final IOException e) {
LOGGER.log(Level.INFO, "Communication was abrubptly interrupted", e);
disconnect();
}
} }
connexionLock.wait(connexionTimeout); connexionLock.wait(connexionTimeout);
} }

View File

@@ -7,7 +7,7 @@
</parent> </parent>
<groupId>net.bigeon.gclc</groupId> <groupId>net.bigeon.gclc</groupId>
<artifactId>swt</artifactId> <artifactId>swt</artifactId>
<version>1.2.0</version> <version>1.2.1-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>GCLC swt</name> <name>GCLC swt</name>
<description>A swt window for console applications</description> <description>A swt window for console applications</description>
@@ -36,7 +36,7 @@
</developers> </developers>
<scm> <scm>
<developerConnection>scm:git:gogs@git.code.bigeon.net:emmanuel/gclc.git</developerConnection> <developerConnection>scm:git:gogs@git.code.bigeon.net:emmanuel/gclc.git</developerConnection>
<tag>swt-1.2.0</tag> <tag>HEAD</tag>
</scm> </scm>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>