[mammoth] Move port server operations to their own class.
This commit is contained in:
parent
7989c9d616
commit
5fb9fa6ae6
8 changed files with 74 additions and 42 deletions
|
|
@ -32,11 +32,11 @@ glcr::ErrorCode HandleDenaliRegistration(z_cap_t endpoint_cap) {
|
|||
|
||||
glcr::ErrorOr<YellowstoneServer> YellowstoneServer::Create() {
|
||||
ASSIGN_OR_RETURN(EndpointServer server, EndpointServer::Create());
|
||||
ASSIGN_OR_RETURN(Port port, Port::Create());
|
||||
ASSIGN_OR_RETURN(PortServer port, PortServer::Create());
|
||||
return YellowstoneServer(server, port);
|
||||
}
|
||||
|
||||
YellowstoneServer::YellowstoneServer(EndpointServer server, Port port)
|
||||
YellowstoneServer::YellowstoneServer(EndpointServer server, PortServer port)
|
||||
: server_(server), register_port_(port) {}
|
||||
|
||||
Thread YellowstoneServer::RunServer() {
|
||||
|
|
@ -62,7 +62,7 @@ void YellowstoneServer::ServerThread() {
|
|||
case kYellowstoneGetRegistration: {
|
||||
dbgln("Yellowstone::GetRegistration");
|
||||
uint64_t reg_cap;
|
||||
check(register_port_.Duplicate(®_cap));
|
||||
check(register_port_.CreateClient(®_cap));
|
||||
YellowstoneGetRegistrationResp resp;
|
||||
check(ZReplyPortSend(reply_port_cap, sizeof(resp), &resp, 1, ®_cap));
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue