7 #ifndef __BeaconServer_h__ 8 #define __BeaconServer_h__ 14 #define DEAD_TIME (10000) 21 int64_t lastHeardFromTime;
23 NodeEntry(
const uint8_t _id,
24 const uint32_t _ipdAddress,
25 const uint16_t _replyPort,
26 const int64_t _lastHeardFromTime)
29 ipAddress = _ipdAddress;
30 replyPort = _replyPort;
31 lastHeardFromTime = _lastHeardFromTime;
40 class FE_DL_EXPORT
BeaconServer :
virtual public BeaconServerStartupI
46 virtual bool startup(
const char *fileName) {
return true; }
47 virtual bool start(uint16_t beaconPort, uint16_t gdPort)
override;
48 virtual void stop()
override;
49 virtual bool running()
override;
51 void getList(std::list<NodeEntry> ®isteredNodes);
58 std::atomic<bool> m_done;
59 std::atomic<bool> m_running;
61 std::thread* m_registeringThread;
65 std::list<NodeEntry> m_registeredNodes;
66 std::mutex m_nodeListMutex;
67 fe::ext::Messagegram m_listMsg;
68 fe::ext::Messagegram m_timeMsg;
69 fe::ext::Messagegram m_respMsg;
71 void registrationThread();
73 void add(
const uint32_t ipAddress,
74 const uint16_t replyPort);
75 void remove(
const uint32_t ipAddress);
76 void remove(
const uint8_t id);
77 void keepAlive(
const uint32_t
id);
79 void sendTimeResponse(
const int64_t time,
80 const int64_t estBeaconTime,
82 void sendKeepAliveResponse(
const uint16_t port);
83 void sendUpdatedList();
84 void sendListMsgToAll(
const fe::ext::Messagegram &msg);
86 void checkForDeadNodes();
87 int64_t getCurrentTime();
95 #endif // __BeaconServer_h__ Node registration and simulation time syncronization.
Definition: BeaconServer.h:40
Global Dictionary of name/value strings.
Definition: GlobalDictionary.h:18
Definition: BeaconClient.cc:16