Sandertv / go-raknet

Go library implementing a basic version of the RakNet protocol.
MIT License
106 stars 38 forks source link

Slow connections can block other clients from joining for up to 10 seconds #8

Closed Sandertv closed 4 years ago

Sandertv commented 4 years ago

The Listener.Accept method (https://github.com/Sandertv/go-raknet/blob/master/listener.go#L79) currently does not obtain connections that are ready right away. It gets a connection that still needs to do the RakNet connection sequence, which poses a problem if the client has a poor connection. Listener.Accept can block up to 10 seconds, after which it times out and tries the next connection, until a new client can be accepted. This is a major issue for frequent connection attempts with a high latency.