Initial Release

This commit is contained in:
CJ van den Berg 2024-02-08 22:23:40 +01:00
commit 5a00e06cb9
81 changed files with 12670 additions and 0 deletions

View file

@ -0,0 +1,29 @@
#pragma once
#include <memory>
#include <string_view>
#include <vector>
namespace thespian {
struct socket_impl;
using socket_dtor = void (*)(socket_impl *);
using socket_ref = std::unique_ptr<socket_impl, socket_dtor>;
struct socket {
static auto create(std::string_view tag, int fd) -> socket;
auto write(std::string_view) -> void;
auto write(const std::vector<uint8_t> &) -> void;
auto read() -> void;
auto close() -> void;
//->("socket", tag, "write_complete", int written)
//->("socket", tag, "write_error", int err, string message)
//->("socket", tag, "read_complete", string buf)
//->("socket", tag, "read_error", int err, string message)
//->("socket", tag, "closed")
socket_ref ref;
};
} // namespace thespian