8#include <rdma/fi_endpoint.h>
19 fiCall(::fi_passive_ep,
"Failed to create passive endpoint", fabric->raw(), fabric->info().raw(), &pep,
nullptr);
21 return {pep, fabric,
id, std::nullopt};
50 fiCall(::fi_close,
"Failed to close passive endpoint", &
_raw->fid);
57 ,
_fabric(std::move(other._fabric))
59 ,
_eq(std::move(other._eq))
73 static_assert(std::is_nothrow_move_assignable_v<
decltype(other._fabric)>,
"Member must be nothrow move assignable");
74 static_assert(std::is_nothrow_move_assignable_v<
decltype(other._eq)>,
"Member must be nothrow move assignable");
76 _fabric = std::move(other._fabric);
77 _eq = std::move(other._eq);
84 fiCall(::fi_pep_bind,
"Failed to bind event queue to passive endpoint",
_raw, &eq->raw()->fid, 0);
91 fiCall(::fi_listen,
"Failed to transition the endpoint into listener mode",
_raw);
96 auto fid = entry.
fid();
99 MXL_ERROR(
"Cannot reject a connection notification entry without a fid");
103 fiCall(::fi_reject,
"Failed to reject connection request",
_raw, fid,
nullptr, 0);
static Id randomId() noexcept
Generate a new random endpoint id.
std::uintptr_t Id
An id type that can be used to reference this endpoint from completions and events.
Type to represent an event entry from an EventQueue.
fid_t fid() noexcept
fabric descriptor associated with the event
static Exception internal(fmt::format_string< T... > fmt, T &&... args)
Make an MXL_ERR_INTERNAL exception.
Endpoint::Id id() const noexcept
Get the endpoints id.
std::shared_ptr< Fabric > _fabric
std::shared_ptr< EventQueue > eventQueue() const
Accessor for the associated event queue.
std::optional< std::shared_ptr< EventQueue > > _eq
void bind(std::shared_ptr< EventQueue > eq)
Bind the endpoint to an event queue.
::fid_pep * raw() noexcept
Access the underlying raw fid_pep pointer.
void operator=(PassiveEndpoint const &)=delete
static PassiveEndpoint create(std::shared_ptr< Fabric > fabric)
Allocate a new PassiveEndpoint associated with the given Fabric.
void reject(Event &entry)
Reject a connection request event.
PassiveEndpoint(PassiveEndpoint const &)=delete
void listen()
Put the passive endpoint into listening mode.
void close()
Releases all underlying resources. This is called from the destructor and the move-assignment operato...
void catchAndLogFabricError(F &&fun, std::string_view msg)
int fiCall(F &&fun, std::string_view msg, T &&... args)
Call a libfabric function and check its return code.