mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:27:45 +00:00
LibCore: Move Stream-based sockets into the Core
namespace
This commit is contained in:
parent
d43a7eae54
commit
a96339b72b
123 changed files with 1157 additions and 1100 deletions
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue