mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-28 23:41:03 +00:00
Add socket abstraction
This commit is contained in:
24
src/windows-emulator/network/socket_factory.hpp
Normal file
24
src/windows-emulator/network/socket_factory.hpp
Normal 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);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user