lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
Loading...
Searching...
No Matches
Pds::Bld::Server Class Reference

Packs payloads with BLD headers into an 8192-byte buffer and sends it as one packet when it is full or its first entry is old. More...

#include <Server.hh>

Public Member Functions

 Server (int fd)
 Use socket fd for sending (with send(), so it must be connected); the ID starts at 0 and the buffer is empty.
 
 ~Server ()
 Does nothing; the buffer is not freed.
 
unsigned id () const
 Return the source ID.
 
void setID (uint32_t id)
 Set the source ID written into the full header of each packet.
 
void publish (uint64_t pulseId, uint64_t timeStamp, const char *T, unsigned sizeofT)
 Append a header (full for the first entry of a packet, short otherwise) and the sizeofT-byte payload T.
 
void flush ()
 Send the buffered packet, if any.
 

Detailed Description

Packs payloads with BLD headers into an 8192-byte buffer and sends it as one packet when it is full or its first entry is old.

Used by hpsBldServer and hpsBldCopy in psdaq/app.

Constructor & Destructor Documentation

◆ Server()

Pds::Bld::Server::Server ( int  fd)

Use socket fd for sending (with send(), so it must be connected); the ID starts at 0 and the buffer is empty.

◆ ~Server()

Pds::Bld::Server::~Server ( )

Does nothing; the buffer is not freed.

Member Function Documentation

◆ flush()

void Pds::Bld::Server::flush ( )

Send the buffered packet, if any.

◆ id()

unsigned Pds::Bld::Server::id ( ) const
inline

Return the source ID.

◆ publish()

void Pds::Bld::Server::publish ( uint64_t  pulseId,
uint64_t  timeStamp,
const char *  T,
unsigned  sizeofT 
)

Append a header (full for the first entry of a packet, short otherwise) and the sizeofT-byte payload T.

Send the packet if another payload of this size would not fit or pulseId exceeds the packet's first pulse ID by more than 1023.

◆ setID()

void Pds::Bld::Server::setID ( uint32_t  id)

Set the source ID written into the full header of each packet.


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