#pragma once #include #include #include #include #include #include #include namespace slige_rpc { class RpcServer { public: private: }; struct Ewwow { std::string message; }; namespace { class ClientSocket { public: ~ClientSocket() { close(fd); }; ClientSocket(int fd) : fd(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: Socket(uint16_t port) { this->address = { .sin_family = AF_INET, .sin_port = htons(port), .sin_addr = { .s_addr = inet_addr("127.0.0.1") }, .sin_zero = { 0 }, }; } auto Connect() -> std::variant; auto Bind() -> std::variant; private: sockaddr_in address; }; };