tdaq-develop-2025-02-12
ots::ReceiverSocket Class Reference
Inheritance diagram for ots::ReceiverSocket:
ots::Socket ots::TransceiverSocket ots::UDPDataListenerProducer

Public Member Functions

 ReceiverSocket (std::string IPAddress, unsigned int port=0)
 
int receive (std::string &buffer, unsigned int timeoutSeconds=1, unsigned int timeoutUSeconds=0, bool verbose=false)
 
int receive (std::vector< uint32_t > &buffer, unsigned int timeoutSeconds=1, unsigned int timeoutUSeconds=0, bool verbose=false)
 
int receive (std::string &buffer, unsigned long &fromIPAddress, unsigned short &fromPort, unsigned int timeoutSeconds=1, unsigned int timeoutUSeconds=0, bool verbose=false)
 
int receive (std::vector< uint32_t > &buffer, unsigned long &fromIPAddress, unsigned short &fromPort, unsigned int timeoutSeconds=1, unsigned int timeoutUSeconds=0, bool verbose=false)
 
std::string getLastIncomingIPAddress (void)
 
unsigned short getLastIncomingPort (void)
 
- Public Member Functions inherited from ots::Socket
 Socket (const std::string &IPAddress, unsigned int port=0)
 
virtual void initialize (unsigned int socketReceiveBufferSize=defaultSocketReceiveSize_)
 
const struct sockaddr_in & getSocketAddress (void)
 
const std::string & getIPAddress ()
 
uint16_t getPort ()
 

Protected Member Functions

 ReceiverSocket (void)
 protected constructor
 
- Protected Member Functions inherited from ots::Socket
 Socket (void)
 protected constructor
 

Friends

class TransceiverSocket
 

Additional Inherited Members

- Protected Types inherited from ots::Socket
enum  { maxSocketSize_ = 65536 , defaultSocketReceiveSize_ = 0x10000 }
 
enum  { FirstSocketPort = 10000 , LastSocketPort = 15000 }
 
- Protected Attributes inherited from ots::Socket
struct sockaddr_in socketAddress_
 
int socketNumber_
 
std::string IPAddress_
 
unsigned int requestedPort_
 

Detailed Description

Definition at line 12 of file ReceiverSocket.h.

Member Function Documentation

◆ receive() [1/2]

int ReceiverSocket::receive ( std::string &  buffer,
unsigned long &  fromIPAddress,
unsigned short &  fromPort,
unsigned int  timeoutSeconds = 1,
unsigned int  timeoutUSeconds = 0,
bool  verbose = false 
)

receive ~~ returns 0 on success, -1 on failure NOTE: must call Socket::initialize before receiving!

Definition at line 73 of file ReceiverSocket.cc.

◆ receive() [2/2]

int ReceiverSocket::receive ( std::vector< uint32_t > &  buffer,
unsigned long &  fromIPAddress,
unsigned short &  fromPort,
unsigned int  timeoutSeconds = 1,
unsigned int  timeoutUSeconds = 0,
bool  verbose = false 
)

receive ~~ returns 0 on success, -1 on failure NOTE: must call Socket::initialize before receiving!

Definition at line 199 of file ReceiverSocket.cc.

Friends And Related Function Documentation

◆ TransceiverSocket

friend class TransceiverSocket ( void  )
friend

TransceiverSocket is a "Friend" class of ReceiverSocket so has access to private members.

Definition at line 16 of file ReceiverSocket.h.


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