1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 13:07:46 +00:00

LibIPC: Close the socket and die when the peer is closed

This will close the socket when the recv() returns 0 indicating that
the peer has shutdown, and when there are no pending bytes to be
processed.
This commit is contained in:
Gunnar Beutner 2021-07-15 21:17:43 +10:00 committed by Andreas Kling
parent e331ef7057
commit ab353fd4e1

View file

@ -196,7 +196,7 @@ protected:
}
if (nread == 0) {
if (bytes.is_empty()) {
deferred_invoke([this](auto&) { die(); });
deferred_invoke([this](auto&) { shutdown(); });
}
return false;
}