28 #ifndef ROSCPP_TRANSPORT_HINTS_H 29 #define ROSCPP_TRANSPORT_HINTS_H 34 #include <boost/lexical_cast.hpp> 72 transports_.push_back(
"TCP");
84 options_[
"tcp_nodelay"] = nodelay ?
"true" :
"false";
93 M_string::iterator it = options_.find(
"tcp_nodelay");
94 if (it == options_.end())
99 const std::string& val = it->second;
115 options_[
"max_datagram_size"] = boost::lexical_cast<std::string>(size);
125 M_string::iterator it = options_.find(
"max_datagram_size");
126 if (it == options_.end())
131 return boost::lexical_cast<
int>(it->second);
149 transports_.push_back(
"UDP");
bool getTCPNoDelay()
Returns whether or not this TransportHints has specified TCP_NODELAY.
TransportHints & reliable()
Specifies a reliable transport. Currently this means TCP.
TransportHints & udp()
Explicitly specifies a UDP transport.
const M_string & getOptions()
Returns the map of options created by other methods inside TransportHints.
Provides a way of specifying network transport hints to ros::NodeHandle::subscribe() and someday ros:...
TransportHints & maxDatagramSize(int size)
If a UDP transport is used, specifies the maximum datagram size.
std::map< std::string, std::string > M_string
TransportHints & tcpNoDelay(bool nodelay=true)
If a TCP transport is used, specifies whether or not to use TCP_NODELAY to provide a potentially lowe...
std::vector< std::string > V_string
TransportHints & unreliable()
Specifies an unreliable transport. Currently this means UDP.
int getMaxDatagramSize()
Returns the maximum datagram size specified on this TransportHints, or 0 if no size was specified...
const V_string & getTransports()
Returns a vector of transports, ordered by preference.
TransportHints & tcp()
Explicitly specifies the TCP transport.