|
lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
|
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. | |
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.
| 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.
| Pds::Bld::Server::~Server | ( | ) |
Does nothing; the buffer is not freed.
| void Pds::Bld::Server::flush | ( | ) |
Send the buffered packet, if any.
|
inline |
Return the source ID.
| 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.
| void Pds::Bld::Server::setID | ( | uint32_t | id | ) |
Set the source ID written into the full header of each packet.