1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:47:44 +00:00

LibCore: Move Stream-based sockets into the Core namespace

This commit is contained in:
Tim Schumacher 2023-02-08 23:05:44 +01:00 committed by Linus Groh
parent d43a7eae54
commit a96339b72b
123 changed files with 1157 additions and 1100 deletions

View file

@ -8,6 +8,7 @@
#include <AK/IPv4Address.h>
#include <AK/Types.h>
#include <LibCore/Notifier.h>
#include <LibCore/Socket.h>
#include <LibCore/System.h>
#include <LibCore/TCPServer.h>
@ -74,7 +75,7 @@ ErrorOr<void> TCPServer::set_blocking(bool blocking)
return {};
}
ErrorOr<NonnullOwnPtr<Stream::TCPSocket>> TCPServer::accept()
ErrorOr<NonnullOwnPtr<TCPSocket>> TCPServer::accept()
{
VERIFY(m_listening);
sockaddr_in in;
@ -85,7 +86,7 @@ ErrorOr<NonnullOwnPtr<Stream::TCPSocket>> TCPServer::accept()
int accepted_fd = TRY(Core::System::accept(m_fd, (sockaddr*)&in, &in_size));
#endif
auto socket = TRY(Stream::TCPSocket::adopt_fd(accepted_fd));
auto socket = TRY(TCPSocket::adopt_fd(accepted_fd));
#ifdef AK_OS_MACOS
// FIXME: Ideally, we should let the caller decide whether it wants the