1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:37:35 +00:00

IPv4: Basic implementation of TCP socket shutdown

We can now participate in the TCP connection closing handshake. :^)
This implementation is definitely not complete and needs to handle a
bunch of other cases. But it's a huge improvement over not being able
to close connections at all.

Note that we hold on to pending-close sockets indefinitely, until they
are moved into the Closed state. This should also have a timeout but
that's still a FIXME. :^)

Fixes #428.
This commit is contained in:
Andreas Kling 2020-02-08 15:52:32 +01:00
parent 8325662186
commit 228a1e9099
7 changed files with 69 additions and 8 deletions

View file

@ -46,6 +46,7 @@ public:
static Lockable<HashTable<IPv4Socket*>>& all_sockets();
virtual void close() override;
virtual KResult bind(const sockaddr*, socklen_t) override;
virtual KResult connect(FileDescription&, const sockaddr*, socklen_t, ShouldBlock = ShouldBlock::Yes) override;
virtual KResult listen(int) override;