#pragma once #include #include #include "mammoth/ipc/port_client.h" namespace mmth { class PortServer { public: PortServer() {} static glcr::ErrorOr Create(); static PortServer AdoptCap(z_cap_t cap); glcr::ErrorOr CreateClient(); glcr::ErrorCode RecvCap(uint64_t* num_bytes, char* msg, uint64_t* cap); glcr::ErrorCode PollForIntCap(uint64_t* msg, uint64_t* cap); z_cap_t cap() { return port_cap_; } private: z_cap_t port_cap_; PortServer(z_cap_t cap); }; } // namespace mmth