MADARA  3.1.8
UdpTransport.h
Go to the documentation of this file.
1 #ifndef _MADARA_UDP_TRANSPORT_H_
2 #define _MADARA_UDP_TRANSPORT_H_
3 
4 #include <string>
5 
6 #include "madara/MADARA_export.h"
10 
11 #include <string>
12 #include <map>
13 
14 #include "ace/INET_Addr.h"
15 #include "ace/SOCK_Dgram.h"
16 
17 
18 namespace madara
19 {
20  namespace transport
21  {
34  class MADARA_Export UdpTransport : public Base
35  {
36  public:
37 
38  enum {
40  };
41 
42  enum {
43  ERROR_UDP_NOT_STARTED = -1,
44  };
45 
46  static const int PROFILES = 1;
47 
55  UdpTransport (const std::string & id,
57  TransportSettings & config, bool launch_transport);
58 
62  virtual ~UdpTransport ();
63 
69  long send_data (const madara::knowledge::KnowledgeRecords & updates);
70 
76  int reliability (void) const;
77 
83  int reliability (const int & setting);
84  long read (void);
85  void close (void);
86  int setup (void);
87  protected:
88  private:
91 
94 
95  std::map <std::string, ACE_INET_Addr> addresses_;
96 
98  ACE_SOCK_Dgram write_socket_;
99 
101  ACE_SOCK_Dgram read_socket_;
102  };
103  }
104 }
105 
106 #endif // _MADARA_UDP_TRANSPORT_H_
This class stores variables and their values for use by any entity needing state information in a thr...
knowledge::KnowledgeBase knowledge_
knowledge base for threads to use
Definition: UdpTransport.h:90
std::map< std::string, ACE_INET_Addr > addresses_
Definition: UdpTransport.h:95
Holds basic transport settings.
threads::Threader read_threads_
threads for reading knowledge updates
Definition: UdpTransport.h:93
This class provides a distributed knowledge base to users.
Definition: KnowledgeBase.h:44
::std::map< std::string, KnowledgeRecord * > KnowledgeRecords
ACE_SOCK_Dgram write_socket_
underlying socket for sending
Definition: UdpTransport.h:98
ACE_SOCK_Dgram read_socket_
The socket we are reading from.
Definition: UdpTransport.h:101
static constexpr struct madara::knowledge::tags::string_t string
Starts threads with first class support of MADARA contexts.
Definition: Threader.h:35
Copyright (c) 2015 Carnegie Mellon University.
UDP-based transport for knowledge.
Definition: UdpTransport.h:34
Base class from which all transports must be derived.
Definition: Transport.h:62