#pragma once #include #include "iserver.hpp" template class ManagedPortServer : public IServer { public: ManagedPortServer(const char *service_name, unsigned int max_s, bool s_d = false) : IServer(service_name, max_s, s_d) { if (R_FAILED(svcManageNamedPort(&this->port_handle, service_name, this->max_sessions))) { /* TODO: panic */ } } ISession *get_new_session(Handle session_h) override { return new ServiceSession(this, session_h, 0); } };