mvsim-cli
mvsim-cli-server.cpp
Go to the documentation of this file.
1
/*+-------------------------------------------------------------------------+
2
| MultiVehicle simulator (libmvsim) |
3
| |
4
| Copyright (C) 2014-2023 Jose Luis Blanco Claraco |
5
| Copyright (C) 2017 Borys Tymchenko (Odessa Polytechnic University) |
6
| Distributed under 3-clause BSD License |
7
| See COPYING |
8
+-------------------------------------------------------------------------+ */
9
10
#include <mrpt/core/exceptions.h>
11
#include <
mvsim/Comms/Server.h
>
12
#include <
mvsim/Comms/ports.h
>
// MVSIM_PORTNO_MAIN_REP
13
14
#include "
mvsim-cli.h
"
15
16
std::shared_ptr<mvsim::Server>
server
;
17
18
void
commonLaunchServer
()
19
{
20
ASSERT_(!
server
);
21
22
// Start network server:
23
server
= std::make_shared<mvsim::Server>();
24
25
if
(
cli
->argPort.isSet())
server
->listenningPort(
cli
->argPort.getValue());
26
27
server
->setMinLoggingLevel(
28
mrpt::typemeta::TEnumType<mrpt::system::VerbosityLevel>::name2value(
29
cli
->argVerbosity.getValue()));
30
31
server
->start();
32
}
33
34
int
launchStandAloneServer
()
35
{
36
if
(
cli
->argHelp.isSet())
37
{
38
fprintf(
39
stdout,
40
R
"XXX(Usage: mvsim server
41
42
Available options:
43
-p %5u, --port %5u Listen on given TCP port.
44
-v, --verbosity Set verbosity level: DEBUG, INFO (default), WARN, ERROR
45
)XXX",
46
mvsim::MVSIM_PORTNO_MAIN_REP
,
mvsim::MVSIM_PORTNO_MAIN_REP
);
47
return
0;
48
}
49
50
commonLaunchServer
();
51
return
0;
52
}
commonLaunchServer
void commonLaunchServer()
Definition:
mvsim-cli-server.cpp:18
launchStandAloneServer
int launchStandAloneServer()
Definition:
mvsim-cli-server.cpp:34
Server.h
ports.h
mvsim::MVSIM_PORTNO_MAIN_REP
constexpr unsigned int MVSIM_PORTNO_MAIN_REP
Definition:
ports.h:17
cli
std::unique_ptr< cli_flags > cli
Definition:
mvsim-cli-main.cpp:24
server
std::shared_ptr< mvsim::Server > server
Definition:
mvsim-cli-server.cpp:16
mvsim-cli.h
mvsim
Author(s):
autogenerated on Tue Jul 4 2023 03:08:21