1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:28:10 +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

@ -500,3 +500,8 @@ int IPv4Socket::ioctl(FileDescription&, unsigned request, unsigned arg)
return -EINVAL;
}
void IPv4Socket::close()
{
shutdown(SHUT_RDWR);
}