mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-28 15:31:02 +00:00
Add socket abstraction
This commit is contained in:
26
src/windows-emulator/network/i_socket.hpp
Normal file
26
src/windows-emulator/network/i_socket.hpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#include <span>
|
||||
#include <network/socket.hpp>
|
||||
|
||||
namespace network
|
||||
{
|
||||
struct i_socket
|
||||
{
|
||||
virtual ~i_socket() = default;
|
||||
|
||||
virtual void set_blocking(bool blocking) = 0;
|
||||
|
||||
virtual int get_last_error() = 0;
|
||||
|
||||
virtual bool is_ready(bool in_poll) = 0;
|
||||
|
||||
virtual bool bind(const address& addr) = 0;
|
||||
|
||||
virtual sent_size send(std::span<const std::byte> data) = 0;
|
||||
virtual sent_size sendto(const address& destination, std::span<const std::byte> data) = 0;
|
||||
|
||||
virtual sent_size recv(std::span<std::byte> data) = 0;
|
||||
virtual sent_size recvfrom(address& source, std::span<std::byte> data) = 0;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user