Add socket abstraction

This commit is contained in:
Maurice Heumann
2025-03-20 15:17:43 +01:00
parent 2cb14a3555
commit 4da6642123
15 changed files with 437 additions and 71 deletions

View File

@@ -0,0 +1,24 @@
#pragma once
#include "i_socket.hpp"
#include <memory>
namespace network
{
struct poll_entry
{
i_socket* s{};
int16_t events{};
int16_t revents{};
};
struct socket_factory
{
socket_factory();
virtual ~socket_factory() = default;
virtual std::unique_ptr<i_socket> create_socket(int af, int type, int protocol);
virtual int poll_sockets(std::span<poll_entry> entries);
};
}