![]() |
|
Welcome to the Monastery | |
PerlMonks |
Re^2: Perl alarm not going off when local websocket connection is activeby cavac (Prior) |
on May 05, 2025 at 14:45 UTC ( [id://11164944]=note: print w/replies, xml ) | Need Help?? |
Cyclic callbacks might also be an option. My guess is those are already implemented in some way to handle the cyclic nature of the game logic (if it's one of those real time games). So setting a player state for "is in timeout since..." and checking that in the cyclic callback could also be an option. Additionally, in my own software, i send regular messages (pings) in both directions. This keeps the connection open (especially on NATed networks), and also provides the functionality to check for application timeouts. (Just because a connection is open doesn't mean the application at the other end still functions correctly).
PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP Also check out my sisters artwork and my weekly webcomics
In Section
Seekers of Perl Wisdom
|
|