openMSX
CliServer.hh
Go to the documentation of this file.
1 #ifndef CLISERVER_HH
2 #define CLISERVER_HH
3 
4 #include "Poller.hh"
5 #include "Socket.hh"
6 #include <string>
7 #include <thread>
8 
9 namespace openmsx {
10 
11 class CommandController;
12 class EventDistributor;
13 class GlobalCliComm;
14 
15 class CliServer final
16 {
17 public:
18  CliServer(CommandController& commandController,
19  EventDistributor& eventDistributor,
20  GlobalCliComm& cliComm);
21  ~CliServer();
22 
23 private:
24  void mainLoop();
25  [[nodiscard]] SOCKET createSocket();
26  void exitAcceptLoop();
27 
28 private:
29  CommandController& commandController;
30  EventDistributor& eventDistributor;
31  GlobalCliComm& cliComm;
32 
33  std::thread thread;
34  std::string socketName;
35  SOCKET listenSock;
36  Poller poller;
37 };
38 
39 } // namespace openmsx
40 
41 #endif
CliServer(CommandController &commandController, EventDistributor &eventDistributor, GlobalCliComm &cliComm)
Definition: CliServer.cc:197
Polls for events on a given file descriptor.
Definition: Poller.hh:14
This file implemented 3 utility functions:
Definition: Autofire.cc:9
int SOCKET
Definition: Socket.hh:22