ChimeraTK-DeviceAccess 03.25.00
Loading...
Searching...
No Matches
main.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Deutsches Elektronen-Synchrotron DESY, MSK, ChimeraTK Project <chimeratk-support@desy.de>
2// SPDX-License-Identifier: LGPL-3.0-or-later
3
4#include "argumentParser.h"
5#include "RebotDummyServer.h"
6
7#include <iostream>
8
9int main(int, char** argv) {
10 unsigned int portNumber = getPortNumber(argv);
11 std::string mapFileLocation = getMapFileLocation(argv);
12 unsigned int protocolVersion = getProtocolVersion(argv);
13
14 ChimeraTK::RebotDummyServer testServer(portNumber, mapFileLocation, protocolVersion);
15 boost::asio::signal_set signals(testServer.service(), SIGINT, SIGTERM);
16 signals.async_wait([&testServer](const boost::system::error_code& error, int /* signal */) {
17 if(not error) {
18 testServer.stop();
19 }
20 });
21
22 std::cout << "Rebot dummy server started" << std::endl;
23 std::cout << "PORT " << testServer.port() << std::endl;
24 testServer.start();
25 std::cout << "Rebot dummy server stopped" << std::endl;
26
27 return 0;
28}
int main()
std::string getMapFileLocation(char **)
unsigned int getProtocolVersion(char **)
unsigned int getPortNumber(char **)
unsigned int port() const
boost::asio::io_context & service()