MADARA  3.1.8
MulticastTransport.h
Go to the documentation of this file.
1 #ifndef _MADARA_MULTICAST_TRANSPORT_H_
2 #define _MADARA_MULTICAST_TRANSPORT_H_
3 
12 #include <string>
13 
14 #include "madara/MADARA_export.h"
19 #include "ace/SOCK_Dgram.h"
20 #include "ace/SOCK_Dgram_Mcast.h"
25 
26 namespace madara
27 {
28  namespace transport
29  {
42  class MADARA_Export MulticastTransport : public Base
43  {
44  public:
52  MulticastTransport (const std::string & id,
54  TransportSettings & config, bool launch_transport);
55 
59  virtual ~MulticastTransport ();
60 
66  long send_data (const madara::knowledge::KnowledgeRecords & updates);
67 
71  void close (void);
72 
77  int reliability (void) const;
78 
83  int reliability (const int & setting);
84 
89  int setup (void);
90 
91  private:
92 
95 
98 
100  std::vector <ACE_INET_Addr> addresses_;
101 
103  std::vector <std::string> splitters_;
104 
106  ACE_SOCK_Dgram write_socket_;
107 
109  ACE_SOCK_Dgram_Mcast read_socket_;
110  };
111  }
112 }
113 
114 #endif // _MADARA_MULTICAST_TRANSPORT_H_
ACE_SOCK_Dgram_Mcast read_socket_
The multicast socket we are reading from.
threads::Threader read_threads_
threads for reading knowledge updates
Multicast-based transport for knowledge.
ACE_SOCK_Dgram write_socket_
underlying socket for sending
This class stores variables and their values for use by any entity needing state information in a thr...
std::vector< std::string > splitters_
holds splitters for knowledge multiassignment expression for speed
Holds basic transport settings.
knowledge::KnowledgeBase knowledge_
knowledge base for threads to use
This class provides a distributed knowledge base to users.
Definition: KnowledgeBase.h:44
::std::map< std::string, KnowledgeRecord * > KnowledgeRecords
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.
std::vector< ACE_INET_Addr > addresses_
holds all multicast addresses we are sending to
Base class from which all transports must be derived.
Definition: Transport.h:62