libMVRgdtf 40bc00a
A library for GDTF and MVR
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mvrxchange_server.h
Go to the documentation of this file.
1//-----------------------------------------------------------------------------
2//----- Copyright MVR Group
3//-----------------------------------------------------------------------------
4
5#pragma once
6
7#include "mvrxchange_prefix.h"
9
10namespace MVRxchangeNetwork
11{
12 class MVRxchangeSession;
14 {
15 public:
18
19 uint16_t GetPort() const;
20 uint32_t GetIP() const;
21 void AddSession(const std::shared_ptr<MVRxchangeSession>&);
22 void CloseSession(const std::shared_ptr<MVRxchangeSession>&);
23 inline bool isRunning() const { return !fContext.stopped(); }
24
25 private:
26 void DoAccept();
27 void ExecutionFunction();
28
30
31 tcp::endpoint fEndpoint;
32 boost::asio::io_context fContext;
33 tcp::acceptor fAcceptor;
34
35 std::thread fExecutionThread;
36
37 uint16_t fPort;
38 uint32_t fIp;
39
40 std::mutex mSession;
41 std::set<std::shared_ptr<MVRxchangeSession>> fSession;
42 };
43}
Definition mvrxchange_server.h:14
~MVRxchangeServer()
Definition mvrxchange_server.cpp:25
uint16_t GetPort() const
Definition mvrxchange_server.cpp:72
bool isRunning() const
Definition mvrxchange_server.h:23
uint32_t GetIP() const
Definition mvrxchange_server.cpp:77
void AddSession(const std::shared_ptr< MVRxchangeSession > &)
Definition mvrxchange_server.cpp:60
void CloseSession(const std::shared_ptr< MVRxchangeSession > &)
Definition mvrxchange_server.cpp:66
Definition CMVRxchangeService.h:27
Definition mvrxchange_client.h:11