1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 18:57:35 +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

@ -6,11 +6,12 @@
#pragma once
#include <LibCore/Socket.h>
#include <LibCore/Stream.h>
class Client : public RefCounted<Client> {
public:
static NonnullRefPtr<Client> create(int id, NonnullOwnPtr<Core::Stream::TCPSocket> socket)
static NonnullRefPtr<Client> create(int id, NonnullOwnPtr<Core::TCPSocket> socket)
{
return adopt_ref(*new Client(id, move(socket)));
}
@ -18,12 +19,12 @@ public:
Function<void()> on_exit;
protected:
Client(int id, NonnullOwnPtr<Core::Stream::TCPSocket> socket);
Client(int id, NonnullOwnPtr<Core::TCPSocket> socket);
ErrorOr<void> drain_socket();
void quit();
private:
int m_id { 0 };
NonnullOwnPtr<Core::Stream::TCPSocket> m_socket;
NonnullOwnPtr<Core::TCPSocket> m_socket;
};