1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:38:11 +00:00

LocalSocket: Teach recvfrom() how to block if needed, and simplify it

If we can't already read when we enter recvfrom() on a LocalSocket,
we'll now block the current thread until we can.

Also added a buffer_for(FileDescription&) helper so that the client
and server can share some of the code. :^)
This commit is contained in:
Andreas Kling 2019-09-22 21:30:30 +02:00
parent 34d0e96aec
commit 65409e8f04
2 changed files with 26 additions and 23 deletions

View file

@ -36,6 +36,7 @@ private:
virtual bool is_local() const override { return true; }
bool has_attached_peer(const FileDescription&) const;
static Lockable<InlineLinkedList<LocalSocket>>& all_sockets();
DoubleBuffer& buffer_for(FileDescription&);
// An open socket file on the filesystem.
RefPtr<FileDescription> m_file;