when I terminate server (or client) or interrupt tcp connection somehow (unplugging ethernet cable) other side is unable to cope with this and gets stuck in endless loop. There is an IOException poping out in TCPConnection that probably causes this. It would be nice to handle it appropriately, not just log it.
Error message is in Czech, saying that current connection was terminated by remote host
SEVERE: [Server#1][???] Error while selecting. Message: Stávající připojení bylo vynuceně ukončeno vzdáleným hostitelem
3.11.2010 13:58:38 com.jme3.network.connection.Connection run
and stack trace of this exception:
java.io.IOException: Stávající připojení bylo vynuceně ukončeno vzdáleným hostitelem
at sun.nio.ch.SocketDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:25)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:233)
at sun.nio.ch.IOUtil.read(IOUtil.java:200)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:236)
at com.jme3.network.connection.TCPConnection.read(TCPConnection.java:138)
at com.jme3.network.connection.Connection.run(Connection.java:124)
at com.jme3.network.connection.ConnectionRunnable.run(ConnectionRunnable.java:77)
at java.lang.Thread.run(Thread.java:619)
code to reproduce it:
Server
[java]
public class Jme3test {
public static void main(String[] args) throws IOException {
Server s = new Server(32233, 32233);
s.start();
}
}
[/java]
Client
[java]
public class Jme3testcli {
public static void main(String[] args) throws IOException {
Client c = new Client("localhost", 32233, 32233);
c.start();
}
}
[/java]
Compile it, run it, then kill one of sides with task manager