MCPcopy Create free account
hub / github.com/averne/Fizeau / Server

Class Server

sysmodule/src/server.hpp:26–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24namespace fz {
25
26class Server: public IpcServer {
27 public:
28 constexpr static inline std::string_view ServiceName = "fizeau";
29 constexpr static inline int ServiceNumSessions = 2;
30
31 public:
32 constexpr Server(Context &context, ProfileManager &profile): IpcServer(), context(context), profile(profile) { }
33
34 Result initialize() {
35 return ipcServerInit(this, Server::ServiceName.data(), Server::ServiceNumSessions);
36 }
37
38 Result finalize() {
39 return ipcServerExit(this);
40 }
41
42 Result process() {
43 return ipcServerProcess(this, &command_handler, this);
44 }
45
46 Result loop() {
47 while (true) {
48 switch (auto rc = this->process()) {
49 case 0:
50 case KERNELRESULT(ConnectionClosed):
51 break;
52 default:
53 if (R_MODULE(rc) != FIZEAU_RC_MODULE)
54 return rc;
55 break;
56 }
57 }
58 }
59
60 private:
61 static Result command_handler(void *userdata, const IpcServerRequest *r, u8 *out_data, size_t *out_datasize);
62
63 private:
64 Context &context;
65 ProfileManager &profile;
66
67 bool running = false;
68};
69
70} // namespace fz

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected