STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
daq_comms::transport::NetworkSocket Class Referenceabstract

Abstract base for network socket operations. More...

#include <NetworkSocket.hpp>

Inheritance diagram for daq_comms::transport::NetworkSocket:
[legend]

Public Member Functions

virtual ~NetworkSocket ()=default
virtual ssize_t receive (uint8_t *buffer, size_t max_size)=0
 Receive data from the socket.
virtual ssize_t send (const uint8_t *data, size_t size)=0
 Send data through the socket.
virtual bool is_valid () const =0
 Check if socket is valid and ready.
virtual std::string last_error () const =0
 Get the last error message.

Detailed Description

Abstract base for network socket operations.

Provides a clean interface for UDP/TCP socket operations without exposing platform-specific details.

Definition at line 16 of file NetworkSocket.hpp.

Constructor & Destructor Documentation

◆ ~NetworkSocket()

virtual daq_comms::transport::NetworkSocket::~NetworkSocket ( )
virtualdefault

Member Function Documentation

◆ is_valid()

virtual bool daq_comms::transport::NetworkSocket::is_valid ( ) const
pure virtual

Check if socket is valid and ready.

Implemented in daq_comms::transport::TCPSocket, and daq_comms::transport::UDPSocket.

◆ last_error()

virtual std::string daq_comms::transport::NetworkSocket::last_error ( ) const
pure virtual

Get the last error message.

Implemented in daq_comms::transport::TCPSocket, and daq_comms::transport::UDPSocket.

◆ receive()

virtual ssize_t daq_comms::transport::NetworkSocket::receive ( uint8_t * buffer,
size_t max_size )
pure virtual

Receive data from the socket.

Parameters
bufferBuffer to store received data
max_sizeMaximum bytes to receive
Returns
Number of bytes received, or -1 on error

Implemented in daq_comms::transport::TCPSocket, and daq_comms::transport::UDPSocket.

◆ send()

virtual ssize_t daq_comms::transport::NetworkSocket::send ( const uint8_t * data,
size_t size )
pure virtual

Send data through the socket.

Parameters
dataData to send
sizeNumber of bytes to send
Returns
Number of bytes sent, or -1 on error

Implemented in daq_comms::transport::TCPSocket, and daq_comms::transport::UDPSocket.


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