fipa_services
OutgoingConnection.hpp
Go to the documentation of this file.
1 #ifndef FIPA_SERVICES_TRANSPORTS_OUTGOING_CONNECTION_HPP
2 #define FIPA_SERVICES_TRANSPORTS_OUTGOING_CONNECTION_HPP
3 
4 #include <boost/shared_ptr.hpp>
5 #include <fipa_services/transports/Connection.hpp>
6 
7 namespace fipa {
8 namespace services {
9 namespace transports {
10 
16 {
17 public:
18  typedef boost::shared_ptr<OutgoingConnection> Ptr;
19 
21  OutgoingConnection(const std::string& ipaddress, uint16_t port);
22  OutgoingConnection(const Address& address);
23  virtual ~OutgoingConnection() {};
24 
31  virtual void connect(const std::string& ipaddress, uint16_t port) = 0;
32 
37  virtual void send(const std::string& data) = 0;
38 
42  void setTTL(int ttl) { mTTL = ttl; }
43 
47  int getTTL() const { return mTTL; }
48 
49 protected:
50  int mTTL;
51 };
52 
53 } // end namespace transports
54 } // end namespace services
55 } // end namespace fipa
56 #endif // FIPA_SERVICES_TRANSPORTS_OUTGOING_CONNECTION_HPP
int mTTL
Definition: OutgoingConnection.hpp:50
A connection is defined by a communication address.
Definition: Connection.hpp:15
void setTTL(int ttl)
Definition: OutgoingConnection.hpp:42
boost::shared_ptr< OutgoingConnection > Ptr
Definition: OutgoingConnection.hpp:18
int getTTL() const
Definition: OutgoingConnection.hpp:47
A unidirectional, outgoing connection that allows to send fipa letters to a receiver.
Definition: OutgoingConnection.hpp:15
Communication address specified by IP, port, and protocol.
Definition: Address.hpp:15
virtual ~OutgoingConnection()
Definition: OutgoingConnection.hpp:23
OutgoingConnection()
Definition: OutgoingConnection.cpp:8
virtual void send(const std::string &data)=0
virtual void connect(const std::string &ipaddress, uint16_t port)=0
Definition: DistributedServiceDirectory.cpp:5