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
7#include <string>
8#include <thread>
9
10namespace openmsx {
11
12class CommandController;
13class EventDistributor;
14class GlobalCliComm;
15
16class CliServer final
17{
18public:
19 CliServer(CommandController& commandController,
20 EventDistributor& eventDistributor,
21 GlobalCliComm& cliComm);
22 ~CliServer();
23
24private:
25 void mainLoop();
26 [[nodiscard]] SOCKET createSocket();
27 void exitAcceptLoop();
28
29private:
30 CommandController& commandController;
31 EventDistributor& eventDistributor;
32 GlobalCliComm& cliComm;
33
34 std::thread thread;
35 std::string socketName;
36 SOCKET listenSock = OPENMSX_INVALID_SOCKET;
37 Poller poller;
38 [[no_unique_address]] SocketActivator socketActivator;
39};
40
41} // namespace openmsx
42
43#endif
Polls for events on a given file descriptor.
Definition Poller.hh:15
This file implemented 3 utility functions:
Definition Autofire.cc:11
constexpr int OPENMSX_INVALID_SOCKET
Definition Socket.hh:23
int SOCKET
Definition Socket.hh:25