EsotericSoftware / EsotericSoftware/kryonet

Server disposing

Open
#82 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.9k
Forks
411
PR merge metrics
No merged PRs in 30d

Description

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

``` java
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

``` java
@Override
public void onDispose() {
try {
server.dispose();
}
catch (IOException e) {
e.printStackTrace();
}
}
```

there are no errors.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.