|
lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
|
Accepts client connections on a passive endpoint and receives their notifications. More...
#include <EbLfServer.hh>
Public Member Functions | |
| EbLfServer (const unsigned &verbose) | |
| Construct with default libfabric hints; nothing is opened until listen(). | |
| EbLfServer (const unsigned &verbose, const std::map< std::string, std::string > &kwargs) | |
| Construct with libfabric hints built from kwargs (see Fabrics::Info); nothing is opened until listen(). | |
| ~EbLfServer () | |
| Delete all links, the receive completion queue, the event queue and the passive endpoint. | |
| int | listen (const std::string &addr, std::string &port, unsigned nLinks) |
| Create a passive endpoint on addr:port and start listening with a backlog of nLinks. | |
| int | connect (EbLfSvrLink **, unsigned nLinks, int msTmo=-1) |
| Accept one connection, waiting up to msTmo ms, and store a new EbLfSvrLink in the first argument. | |
| int | disconnect (EbLfSvrLink *) |
| Delete the link and close its endpoint; the shared queues are deleted when no links remain. | |
| void | shutdown () |
| Delete the passive endpoint. | |
| int | pend (fi_cq_data_entry *, int msTmo) |
| Get one receive completion into the entry. | |
| int | pend (void **context, int msTmo) |
| Call pend(fi_cq_data_entry*, msTmo) and store the completion's op_context in context; it is stored even when no completion was read. | |
| int | pend (uint64_t *data, int msTmo) |
| Call pend(fi_cq_data_entry*, msTmo) and store the completion's immediate data in data; it is stored even when no completion was read. | |
| int | poll (uint64_t *data) |
| Read one receive completion in the current polling or waiting mode (see pend()) and store its immediate data in data (0 if none). | |
| int | pollEQ () |
| Read one event from the shared event queue without blocking. | |
| int | setupMr (void *region, size_t size) |
| Register (or reuse) a memory region for size bytes at region on the passive endpoint's fabric; returns -1 if there is no passive endpoint. | |
| uint64_t | pending () const |
| Return the shared pending word (incremented while pend() or a link's timed poll() is waiting). | |
| uint64_t | posting () const |
| Return the shared posting word, a bit list of peer IDs currently posting. | |
Accepts client connections on a passive endpoint and receives their notifications.
All links share one event queue and one receive completion queue.
| Pds::Eb::EbLfServer::EbLfServer | ( | const unsigned & | verbose | ) |
Construct with default libfabric hints; nothing is opened until listen().
| Pds::Eb::EbLfServer::EbLfServer | ( | const unsigned & | verbose, |
| const std::map< std::string, std::string > & | kwargs | ||
| ) |
Construct with libfabric hints built from kwargs (see Fabrics::Info); nothing is opened until listen().
| Pds::Eb::EbLfServer::~EbLfServer | ( | ) |
Delete all links, the receive completion queue, the event queue and the passive endpoint.
| int Pds::Eb::EbLfServer::connect | ( | EbLfSvrLink ** | , |
| unsigned | nLinks, | ||
| int | msTmo = -1 |
||
| ) |
Accept one connection, waiting up to msTmo ms, and store a new EbLfSvrLink in the first argument.
The shared event queue and receive completion queue (nLinks times the provider receive size) are created on first use. Returns 0 or an error number.
| int Pds::Eb::EbLfServer::disconnect | ( | EbLfSvrLink * | ) |
Delete the link and close its endpoint; the shared queues are deleted when no links remain.
Does nothing for a null link; always returns FI_SUCCESS.
| int Pds::Eb::EbLfServer::listen | ( | const std::string & | addr, |
| std::string & | port, | ||
| unsigned | nLinks | ||
| ) |
Create a passive endpoint on addr:port and start listening with a backlog of nLinks.
If port is empty, the OS chooses a port and it is written back into port. Returns 0 or an error number.
| int Pds::Eb::EbLfServer::pend | ( | fi_cq_data_entry * | , |
| int | msTmo | ||
| ) |
Get one receive completion into the entry.
The server polls first; after 1 ms without a completion it returns -FI_EAGAIN and switches to blocking waits of msTmo ms, going back to polling after a completion. Returns the positive completion count, -FI_EAGAIN, -FI_ENOTCONN if a client disconnected, or another negative error.
|
inline |
Call pend(fi_cq_data_entry*, msTmo) and store the completion's immediate data in data; it is stored even when no completion was read.
|
inline |
Call pend(fi_cq_data_entry*, msTmo) and store the completion's op_context in context; it is stored even when no completion was read.
|
inline |
| int Pds::Eb::EbLfServer::poll | ( | uint64_t * | data | ) |
Read one receive completion in the current polling or waiting mode (see pend()) and store its immediate data in data (0 if none).
Returns the positive count, -FI_EAGAIN, -FI_ENOTCONN if a client disconnected, or another negative error.
| int Pds::Eb::EbLfServer::pollEQ | ( | ) |
Read one event from the shared event queue without blocking.
Returns -FI_ENOTCONN for an FI_SHUTDOWN from a known link (or if there is no queue), -FI_ENOKEY for one from an unknown endpoint, the queue error for other events or read errors, and FI_SUCCESS when no event is available.
|
inline |
Return the shared posting word, a bit list of peer IDs currently posting.
| int Pds::Eb::EbLfServer::setupMr | ( | void * | region, |
| size_t | size | ||
| ) |
Register (or reuse) a memory region for size bytes at region on the passive endpoint's fabric; returns -1 if there is no passive endpoint.
| void Pds::Eb::EbLfServer::shutdown | ( | ) |
Delete the passive endpoint.