#pragma once #include #include #include #include #include #include #include namespace slige_socket { struct Ewwow { std::string message; }; class ClientSocket { public: ClientSocket(int fd) : fd(fd) { } ~ClientSocket() { close(fd); }; auto read(uint8_t* buffer, size_t length) -> std::variant; auto write(uint8_t* buffer, size_t length) -> std::variant; private: int fd; }; class ServerSocket { public: ServerSocket(int fd, sockaddr_in address) : fd(fd) , address(address) { } ~ServerSocket() { close(fd); }; auto accept() -> std::variant; private: int fd; sockaddr_in address; }; class Socket { public: auto static connect(uint16_t port) -> std::variant; auto static bind(uint16_t port) -> std::variant; private: auto static create_address(uint16_t port) -> sockaddr_in; }; };