mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 12:07:45 +00:00
WindowServer: Slurp all available client messages when checking them.
We were reading one client message per client per event loop iteration. That was not very snappy. Make the sockets non-blocking and read() until there are no messages left. It would be even better to make as few calls to read() as possible to reduce context switching, but this is already a huge improvement.
This commit is contained in:
parent
29c49356e3
commit
fbcc8ab840
3 changed files with 33 additions and 27 deletions
|
@ -9,6 +9,7 @@
|
|||
|
||||
class WSMessageReceiver;
|
||||
class Process;
|
||||
struct WSAPI_ClientMessage;
|
||||
struct WSAPI_ServerMessage;
|
||||
|
||||
class WSMessageLoop {
|
||||
|
@ -31,7 +32,7 @@ public:
|
|||
int stop_timer(int timer_id);
|
||||
|
||||
void post_message_to_client(int client_id, const WSAPI_ServerMessage&);
|
||||
ssize_t on_receive_from_client(int client_id, const byte*, size_t);
|
||||
void on_receive_from_client(int client_id, const WSAPI_ClientMessage&);
|
||||
|
||||
static Process* process_from_client_id(int client_id);
|
||||
void notify_client_died(int client_id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue