@Aissen@social.treehouse.systems
Post #1333837
2026-03-27 12:15 UTC
For websocket communication, the server has two tokio tasks per connected client. A task takes care of broadcast, and another of client to server communication. The overhead is 10 to 20 transferred bytes per player action, generating very little CPU load.
#RustInParis
Replies (1)
-
@Aissen@social.treehouse.systems 2026-03-27 12:16
The code for the backend and frontend are quite different. The backend is event-driven, while the frontend is a game client is updated at a fixed game-loop rate (e.g 50 fps). In the middle the transport layer handles communication between the two. And this can cause synchronization issues in some cases. #RustInParis