|
lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
|
Receives BLD multicast packets and returns their payloads one entry at a time; a packet whose source ID differs from getID() is dropped. More...
#include <Client.hh>
Public Member Functions | |
| Client (unsigned interface, unsigned mcaddr, unsigned port) | |
| Open a UDP socket with a 16 MiB receive buffer, bind it to mcaddr and port and join multicast group mcaddr on interface (addresses in host byte order). | |
| ~Client () | |
| Free the packet buffer and close the socket. | |
| void | setID (unsigned v) |
| Set the expected source ID. | |
| unsigned | getID () const |
| Return the expected source ID. | |
| uint64_t | fetch (char *payload, unsigned sizeofT) |
| Copy the next sizeofT-byte payload into payload and return its pulse ID (Header::pulseId() of the packet, plus the 12-bit offset for later entries). | |
Receives BLD multicast packets and returns their payloads one entry at a time; a packet whose source ID differs from getID() is dropped.
Used by hpsBldClient, hpsBldStat and hpsBldCopy in psdaq/app.
| Pds::Bld::Client::Client | ( | unsigned | interface, |
| unsigned | mcaddr, | ||
| unsigned | port | ||
| ) |
Open a UDP socket with a 16 MiB receive buffer, bind it to mcaddr and port and join multicast group mcaddr on interface (addresses in host byte order).
Throws a std::string on failure; the expected ID is not initialized.
| Pds::Bld::Client::~Client | ( | ) |
Free the packet buffer and close the socket.
| uint64_t Pds::Bld::Client::fetch | ( | char * | payload, |
| unsigned | sizeofT | ||
| ) |
Copy the next sizeofT-byte payload into payload and return its pulse ID (Header::pulseId() of the packet, plus the 12-bit offset for later entries).
Receives a new packet when the current one has no complete entry left; returns 0 if that packet's ID differs from getID() and exits the process on a receive error.
|
inline |
Return the expected source ID.
|
inline |
Set the expected source ID.