this may be a stupid question but I don’t know how to solve this problem (yes, I read the networking tutorial):
When I close my server
server.close(); this.addToConsole("Server closed. You may close this window now.");
I get the following exception at the client side:
Termining connection due to unhandled error com.jme3.network.kernel.ConnectorException: Error reading from connection to:localhost/127.0.0.1:6600 at com.jme3.network.kernel.tcp.SocketConnector.read(SocketConnector.java:134) at com.jme3.network.base.ConnectorAdapter.run(ConnectorAdapter.java:158) Caused by: java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:196) at java.net.SocketInputStream.read(SocketInputStream.java:122) at java.net.SocketInputStream.read(SocketInputStream.java:108) at com.jme3.network.kernel.tcp.SocketConnector.read(SocketConnector.java:120) ... 1 more
I understand that the client throws an exception, I also tried working with ClientStateListener but I don’t really know how to use it or catch the exception otherwise…
I just want the client to go back into the main menu (or something like this) when the server closes instead of throwing this exception.
I would really much appreciate a little tip how to do this