Class UDPReceiver

Inheritance Relationships

Base Type

Class Documentation

class UDPReceiver : public ska::pst::recv::Receiver

Concrete implementation of a Receiver that receives a UDP data stream. The data stream is defined by the UDPFormat and is written into local buffers to simulate data acqusition requiring real memory bandwidth.

Public Functions

UDPReceiver(std::shared_ptr<SocketReceive> sock, const std::string &host)

Construct a new UDPReceiver object using provided socket to receive data from the UDP endpoint at host.

Parameters
  • sockSocketReceive on which the data will be received

  • host – IPv4 address on the sock will used

UDPReceiver(std::shared_ptr<SocketReceive> sock, const std::string &host, int port)

Construct a new UDPReceiver object using provided socket to receive data from the UDP endpoint at host:port.

Parameters
  • sockSocketReceive on which the data will be received

  • host – IPv4 address on the sock will used

  • port – UDP port on which the sock will receive data

~UDPReceiver()

Destroy the UDPReceiver object.

void perform_configure_beam()

Process fixed configuration and perform beam resource allocation. Configures the receiver using the fixed configuration parameters that are common to all observations and available at launch. Configures the UDPFormat and UDPStats instances. Opens the UDP socket and allocates memory buffers to receive UDP packets.

void perform_deconfigure_beam()

Release beam resources of the Receiver, which deallocates the receive socket and release the buffer memory.

void perform_configure_scan()

Processes the runtime configuration parameters in the header. Prepares the format with the runtime configuration parameters and starts the monitoring thread.

void perform_deconfigure_scan()

Conclude the format and reset the header and stats.

void perform_scan()

Scan callback that is called by ska::pst::common::ApplicationManager::main. Contains scanning instructions meant to be launched in a separate thread.

void perform_start_scan()

StartScan callback that is called by ska::pst::common::ApplicationManager::main. Contains the instructions required prior to transitioning the state from ScanConfigured to Scanning. Launches perform_scan on a separate thread.

void perform_terminate()

Terminate callback that is called by ka::pst::common::ApplicationManager::main. Contains the instructions required prior to transitioning the state from RuntimeError to Idle.

void receive_block()

Receive a single block of data.

virtual uint64_t get_data_bufsz() override

Return the size of the data buffer.

Returns

uint64_t size of the data buffer in bytes.

Protected Attributes

std::shared_ptr<UDPFormat> format = {nullptr}

UDP format provides the mapping from UDP metadata to memory addresses.

std::shared_ptr<SocketReceive> socket = {nullptr}

UDP receiving socket.

bool have_utc_start = {false}

flag for presence of UTC_START

std::shared_ptr<common::PacketGenerator> data_generator = {nullptr}

Optional PacketGenerator validates the data and weights of incoming stream.