lsalzman / enet

ENet reliable UDP networking library
MIT License
2.66k stars 667 forks source link

enet host service not calling often #230

Open bobi6666 opened 9 months ago

bobi6666 commented 9 months ago

hello, I noticed that if I have an enet server and a client and I use host service 0 on the server, but the main game server loop has a wait timer of, for example, 10 or 20 ms, so if some client times out, I don't always get a disconnect event on the server, I would like to know how that can be solved?

dimage1 commented 4 months ago

Hi, server should eventually understand about a client disconnection based on absence of reliable packets acknowledges. Checking those config params can help you to find a real cause of your issue: checkTimeouts (1), timeoutMinimum (eg 5000), timeoutMaximum (eg 8000), pingInterval (eg 1000). With such params it can take up to 8 seconds for server to realize that there is no client any more.

bobi6666 commented 4 months ago

currently i have settings in rust like this: enet_peer_ping_interval(event.peer, 700); enet_peer_timeout(event.peer, 32, 15000, 20000); and it works niw t notifies me of disconnection but i am still not sure what caused this before? default settings or something else?