Generalize the EndpointServer to require less boilerplate.

Classes can now inherit from the EndpointServer and just implement the
HandleRequest function.
This commit is contained in:
Drew Galbraith 2023-08-01 15:52:08 -07:00
parent 847d37addc
commit caccb08e16
14 changed files with 215 additions and 147 deletions

View file

@ -19,14 +19,14 @@ uint64_t main(uint64_t init_port_cap) {
ASSIGN_OR_RETURN(MappedMemoryRegion ahci_region, stub.GetAhciConfig());
ASSIGN_OR_RETURN(auto driver, AhciDriver::Init(ahci_region));
ASSIGN_OR_RETURN(glcr::UniquePtr<EndpointServer> endpoint,
EndpointServer::Create());
ASSIGN_OR_RETURN(glcr::UniquePtr<DenaliServer> server,
DenaliServer::Create(*driver));
ASSIGN_OR_RETURN(glcr::UniquePtr<EndpointClient> client,
endpoint->CreateClient());
server->CreateClient());
check(stub.Register("denali", *client));
DenaliServer server(glcr::Move(endpoint), *driver);
RET_ERR(server.RunServer());
RET_ERR(server->RunServer());
// FIXME: Add thread join.
return 0;
}