Class SendingInterface

Inheritance Relationships

Base Type

  • public Poco::Runnable

Class Documentation

class SendingInterface : public Poco::Runnable

Interface for sending binary data to “push” consumers (clients)

This class facilitates communication with clients that actively connect to receive data streams, such as sensor data (e.g., laser scans) or odometry It operates as a server, accepting connections and sending data to all connected clients

Public Types

enum class SendingStatus

Enumeration for the status of a data sending operation.

Values:

enumerator SUCCESS
enumerator NO_CONNECTIONS
enumerator NOT_COMPLETED
enumerator RESET_EXCEPTION
enumerator IO_EXCEPTION

Public Functions

SendingInterface(uint16_t port, rclcpp::Node::SharedPtr node)

Constructs a new SendingInterface object.

Parameters:
  • port – The port number on which the server socket will listen for incoming client connections

  • node – A shared pointer to the ROS 2 node, used for logging

void run()

The main execution loop for the sending interface.

virtual ~SendingInterface()

Destroys the SendingInterface object.

SendingStatus sendData(void *data, size_t size)

Sends the given data blob to all currently connected clients.

Parameters:
  • data – A pointer to the raw data buffer to be sent

  • size – The size of the data buffer in bytes

Returns:

A SendingStatus indicating the outcome of the send operation

void stop()

Stops the sending interface’s operation.