kryonet
kryonet copied to clipboard
Server disposing
Hi should we not dispose the server?
I open the connection like in the readme explained and then when I close the app I get the error
00:00 INFO: [kryonet] Server opened.
00:02 INFO: [kryonet] Server closed.
Exception in thread "Server" java.nio.channels.ClosedSelectorException
at sun.nio.ch.SelectorImpl.lockAndDoSelect(Unknown Source)
at sun.nio.ch.SelectorImpl.select(Unknown Source)
at com.esotericsoftware.kryonet.Server.update(Server.java:168)
at com.esotericsoftware.kryonet.Server.run(Server.java:372)
at java.lang.Thread.run(Unknown Source)
If I remove
@Override
public void onDispose() {
try {
server.dispose();
}
catch (IOException e) {
e.printStackTrace();
}
}
there are no errors.
Same thing here, on the Client side. Calling client.dispose() inside libGDX's dispose() method actually hangs for several minutes before letting my game close.
If I remove client.dispose(), everything works fine.
Under what circumstances are we stupposed to dispose ?