MADARA  3.1.8
UdpRegistryServer.h
Go to the documentation of this file.
1 #ifndef _MADARA_UDP_REGISTRY_SERVER_H_
2 #define _MADARA_UDP_REGISTRY_SERVER_H_
3 
4 #include <string>
5 
6 #include "madara/MADARA_export.h"
11 
12 #include <string>
13 #include <map>
14 
15 #include "ace/INET_Addr.h"
16 #include "ace/SOCK_Dgram.h"
17 
18 
19 namespace madara
20 {
21  namespace transport
22  {
28  class MADARA_Export UdpRegistryServer : public Base
29  {
30  public:
31 
32  enum {
34  };
35 
36  enum {
37  ERROR_UDP_NOT_STARTED = -1,
38  };
39 
40  static const int PROFILES = 1;
41 
49  UdpRegistryServer (const std::string & id,
51  TransportSettings & config, bool launch_transport);
52 
56  virtual ~UdpRegistryServer ();
57 
63  long send_data (const madara::knowledge::KnowledgeRecords & updates);
64 
70  int reliability (void) const;
71 
77  int reliability (const int & setting);
78  long read (void);
79  void close (void);
80  int setup (void);
81  protected:
82  private:
85 
88 
90  std::map <std::string, ACE_INET_Addr> servers_;
91 
93  std::map <std::string, ACE_INET_Addr> clients_;
94 
96 
98  ACE_SOCK_Dgram write_socket_;
99 
101  ACE_SOCK_Dgram read_socket_;
102  };
103  }
104 }
105 
106 #endif // _MADARA_UDP_REGISTRY_SERVER_H_
knowledge::KnowledgeBase knowledge_
knowledge base for threads to use
This class stores variables and their values for use by any entity needing state information in a thr...
Holds basic transport settings.
knowledge::containers::Map endpoints_
This class stores a map of strings to KaRL variables.
Definition: Map.h:32
This class provides a distributed knowledge base to users.
Definition: KnowledgeBase.h:44
::std::map< std::string, KnowledgeRecord * > KnowledgeRecords
std::map< std::string, ACE_INET_Addr > clients_
registry clients
ACE_SOCK_Dgram read_socket_
The socket we are reading from.
static constexpr struct madara::knowledge::tags::string_t string
Starts threads with first class support of MADARA contexts.
Definition: Threader.h:35
std::map< std::string, ACE_INET_Addr > servers_
registry servers
ACE_SOCK_Dgram write_socket_
underlying socket for sending
Copyright (c) 2015 Carnegie Mellon University.
Base class from which all transports must be derived.
Definition: Transport.h:62
UDP-based server that handles a registry of UDP endpoints, which makes it ideal for any NAT-protected...
threads::Threader read_threads_
threads for reading knowledge updates