35 #ifndef ROSCPP_TRANSPORT_UDP_H 36 #define ROSCPP_TRANSPORT_UDP_H 41 #include <boost/thread/mutex.hpp> 43 #include <ros/common.h> 53 #define ROS_UDP_DATA0 0 54 #define ROS_UDP_DATAN 1 55 #define ROS_UDP_PING 2 84 bool connect(
const std::string& host,
int port,
int conn_id);
89 std::string getClientURI();
95 bool createIncoming(
int port,
bool is_server);
99 TransportUDPPtr createOutgoing(std::string host,
int port,
int conn_id,
int max_datagram_size);
106 virtual int32_t read(uint8_t* buffer, uint32_t size);
107 virtual int32_t write(uint8_t* buffer, uint32_t size);
109 virtual void enableWrite();
110 virtual void disableWrite();
111 virtual void enableRead();
112 virtual void disableRead();
114 virtual void close();
116 virtual std::string getTransportInfo();
120 virtual const char*
getType() {
return "UDPROS";}
128 bool initializeSocket();
135 bool setSocket(
int sock);
137 void socketUpdate(
int events);
176 #endif // ROSCPP_TRANSPORT_UDP_H boost::mutex close_mutex_
Abstract base class that allows abstraction of the transport type, eg. TCP, shared memory...
Manages a set of sockets being polled through the poll() function call.
sockaddr_in local_address_
virtual const char * getType()
Return a string that details the type of transport (Eg. TCPROS)
uint8_t * reorder_buffer_
boost::shared_ptr< TransportUDP > TransportUDPPtr
std::string cached_remote_host_
uint8_t current_message_id_
struct ros::TransportUDPHeader TransportUDPHeader
int getServerPort() const
Returns the port this transport is listening on.
TransportUDPHeader reorder_header_
sockaddr_in server_address_
virtual bool requiresHeader()
Returns a boolean to indicate if the transport mechanism is reliable or not.
uint32_t max_datagram_size_
int getMaxDatagramSize() const