fipa_services
IncomingConnection.hpp
Go to the documentation of this file.
1 #ifndef FIPA_SERVICES_TRANSPORTS_UDT_INCOMING_CONNECTION_HPP
2 #define FIPA_SERVICES_TRANSPORTS_UDT_INCOMING_CONNECTION_HPP
3 
4 #include <stdexcept>
5 #include <boost/shared_ptr.hpp>
6 #include <udt/udt.h>
7 #include <base-logging/Logging.hpp>
8 #include <fipa_services/transports/Connection.hpp>
9 
10 namespace fipa {
11 namespace services {
12 namespace transports {
13 namespace udt {
14 
20 {
21  UDTSOCKET mSocket;
22 
23 public:
24  typedef boost::shared_ptr<IncomingConnection> Ptr;
25 
28  IncomingConnection(const UDTSOCKET& socket, const std::string& ip, uint16_t port);
29 
34  const UDTSOCKET& getSocket() const { return mSocket; }
35 
40  bool operator==(const IncomingConnection& connection) const { return Connection::operator==(connection); }
41 
48  int receiveMessage(char* buffer, size_t size) const;
49 };
50 
51 typedef std::vector<IncomingConnection::Ptr> IncomingConnections;
52 
53 } // end namespace udt
54 } // end namespace transport
55 } // end namespace services
56 } // end namespace fipa
57 #endif // FIPA_SERVICES_TRANSPORTS_UDT_INCOMING_CONNECTION_HPP
bool operator==(const IncomingConnection &connection) const
Definition: IncomingConnection.hpp:40
A unidirectional, incoming connection to receive incoming messages.
Definition: IncomingConnection.hpp:19
A connection is defined by a communication address.
Definition: Connection.hpp:15
IncomingConnection()
Definition: IncomingConnection.cpp:8
std::vector< IncomingConnection::Ptr > IncomingConnections
Definition: IncomingConnection.hpp:51
const UDTSOCKET & getSocket() const
Definition: IncomingConnection.hpp:34
~IncomingConnection()
Definition: IncomingConnection.cpp:11
boost::shared_ptr< IncomingConnection > Ptr
Definition: IncomingConnection.hpp:24
bool operator==(const Connection &other) const
Definition: Connection.hpp:29
int receiveMessage(char *buffer, size_t size) const
Definition: IncomingConnection.cpp:22
Definition: DistributedServiceDirectory.cpp:5