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

Net: Let Socket have read/write wrappers around sendto/recvfrom

The situations in IPv4Socket and LocalSocket were mirrors of each other
where one had implemented read/write as wrappers and the other had
sendto/recvfrom as wrappers.

Instead of this silliness, move read and write up to the Socket base.
Then mark them final, so subclasses have no choice but to implement
sendto and recvfrom.
This commit is contained in:
Andreas Kling 2019-08-05 10:03:19 +02:00
parent 9111d3626a
commit 6347e3aa51
6 changed files with 37 additions and 47 deletions

View file

@ -60,6 +60,9 @@ public:
Lock& lock() { return m_lock; }
// ^File
virtual ssize_t read(FileDescription&, u8*, ssize_t) override final;
virtual ssize_t write(FileDescription&, const u8*, ssize_t) override final;
virtual String absolute_path(const FileDescription&) const override;
protected: