RTC Toolkit 5.1.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
rtctk::telRepub::UdpReceiver Class Reference

Receiving UDP data asynchronously and forwards received packets to provided packet processors. More...

#include <udpReceiver.hpp>

Public Member Functions

 UdpReceiver (const std::string &receiver_name, std::map< int32_t, QueuePtr > queue_map, size_t buffer_count, componentFramework::ServiceContainer &service, const UdpReceiverCfg &cfg)
 Creates UDP receiver.
 
 ~UdpReceiver () noexcept
 
void Enable ()
 Enables processing UDP data from socket.
 
void Disable ()
 Disables processing UDP data from socket.
 
bool CheckReceiveTimeout ()
 Check for timeout in receiving, and send an alert.
 

Detailed Description

Receiving UDP data asynchronously and forwards received packets to provided packet processors.

UdpReceiver will create udp socket and immediately start reading when constructed. However received packets are not processed until Enable() is called. To disable processing again call Disable().

Constructor & Destructor Documentation

◆ UdpReceiver()

rtctk::telRepub::UdpReceiver::UdpReceiver ( const std::string & receiver_name,
std::map< int32_t, QueuePtr > queue_map,
size_t buffer_count,
componentFramework::ServiceContainer & service,
const UdpReceiverCfg & cfg )
explicit

Creates UDP receiver.

This will create a socket and start a thread reading from this socket. Until Enable() is called all packets are silently read but not processed.

Parameters
receiver_namereceiver's name.
queue_mapMapping of topic IDs to the publisher thread queues.
buffer_countThe number of buffers to store UDP frames.
servicereference to Component service.
cfgreceiver's configuration.

◆ ~UdpReceiver()

rtctk::telRepub::UdpReceiver::~UdpReceiver ( )
noexcept

Member Function Documentation

◆ CheckReceiveTimeout()

bool rtctk::telRepub::UdpReceiver::CheckReceiveTimeout ( )

Check for timeout in receiving, and send an alert.

Returns
true if there is timeout

◆ Disable()

void rtctk::telRepub::UdpReceiver::Disable ( )

Disables processing UDP data from socket.

Thread Safety
thread-safe

◆ Enable()

void rtctk::telRepub::UdpReceiver::Enable ( )

Enables processing UDP data from socket.

Thread Safety
thread-safe

The documentation for this class was generated from the following files: