46 return connection_manager;
111 for(S_Connection::iterator itr = local_connections.begin();
112 itr != local_connections.end();
164 V_Connection::iterator conn_it = local_dropped.begin();
165 V_Connection::iterator conn_end = local_dropped.end();
166 for (;conn_it != conn_end; ++conn_it)
175 std::string client_uri =
"";
176 ROSCPP_LOG_DEBUG(
"UDPROS received a connection from [%s]", client_uri.c_str());
181 conn->initialize(transport,
true, NULL);
187 std::string client_uri = transport->getClientURI();
188 ROSCPP_LOG_DEBUG(
"TCPROS received a connection from [%s]", client_uri.c_str());
202 ROSCPP_CONN_LOG_DEBUG(
"Connection: Creating TransportSubscriberLink for topic [%s] connected to [%s]",
203 val.c_str(), conn->getRemoteString().c_str());
206 sub_link->initialize(conn);
207 ret = sub_link->handleHeader(header);
209 else if (header.
getValue(
"service", val))
211 ROSCPP_LOG_DEBUG(
"Connection: Creating ServiceClientLink for service [%s] connected to [%s]",
212 val.c_str(), conn->getRemoteString().c_str());
215 link->initialize(conn);
216 ret = link->handleHeader(header);
220 ROSCPP_LOG_DEBUG(
"Got a connection for a type other than 'topic' or 'service' from [%s]. Fail.",
221 conn->getRemoteString().c_str());
S_Connection connections_
static const int MAX_TCPROS_CONN_QUEUE
void tcprosAcceptConnection(const TransportTCPPtr &transport)
void udprosIncomingConnection(const TransportUDPPtr &transport, Header &header)
void removeDroppedConnections()
boost::mutex connections_mutex_
void addConnection(const ConnectionPtr &connection)
Add a connection to be tracked by the node. Will automatically remove them if they've been dropped...
TransportTCPPtr tcpserver_transport_
void onConnectionDropped(const ConnectionPtr &conn)
#define ROSCPP_LOG_DEBUG(...)
uint32_t connection_id_counter_
boost::mutex connection_id_counter_mutex_
static const ConnectionManagerPtr & instance()
uint32_t getNewConnectionID()
Get a new connection ID.
std::set< ConnectionPtr > S_Connection
void clear(Connection::DropReason reason)
std::vector< ConnectionPtr > V_Connection
bool onConnectionHeaderReceived(const ConnectionPtr &conn, const Header &header)
boost::signals2::connection poll_conn_
static const PollManagerPtr & instance()
TransportUDPPtr udpserver_transport_
#define ROSCPP_CONN_LOG_DEBUG(...)
boost::mutex dropped_connections_mutex_
ROSCPP_DECL uint16_t getTCPROSPort()
V_Connection dropped_connections_
PollManagerPtr poll_manager_