rpma_ep_next_conn_req(3)
π rpma_ep_next_conn_req(3) π
okay bestie, sit down, hydrate, and let's talk about rpma_ep_next_conn_req from the RPMA Programmer's Manual. this is the little function that goes "hey, somebody's trying to slide into your DMs" β except the DMs are connection requests and the somebody is a remote peer. β¨
πΈ NAME πΈ
rpma_ep_next_conn_req β obtain an incoming connection request π«Ά
like, that's it. that's the whole job. grab the next connection request that showed up at your endpoint. no cap.
π SYNOPSIS π
#include <librpma.h>
struct rpma_ep;
struct rpma_conn_cfg;
struct rpma_conn_req;
int rpma_ep_next_conn_req(struct rpma_ep *ep, const struct rpma_conn_cfg *cfg,
struct rpma_conn_req **req_ptr);
okay so first we declare the types: struct rpma_ep (your endpoint, the main character), struct rpma_conn_cfg (the config, the supporting cast), and struct rpma_conn_req (the request itself, the plot twist). then the function signature drops. π
π¦ DESCRIPTION π¦
rpma_ep_next_conn_req() obtains the next connection request from the endpoint. π
that's the vibe. the endpoint ep is out here living its life, and this function is like "okay what's next in the queue" and hands you back a request through req_ptr. it's giving receptionist energy, honestly. π
π RETURN VALUE π
rpma_ep_next_conn_req() returns 0 on success or a negative error code on failure. π
and listen β on failure, rpma_ep_next_conn_req() does not set the *req_ptr value. so don't go dereferencing it like it's gonna be fine, because it is NOT gonna be fine. check your return code first, always. periodt.
π ERRORS π
rpma_ep_next_conn_req() can fail with the following errors:
RPMA_E_INVALβeporreq_ptrisNULLπ (you passed a nothing where a something should be, bestie)RPMA_E_INVALβ obtained an event different than a connection request π (so you got something, just not the thing you wanted. it's giving wrong order at the drive-thru)RPMA_E_PROVIDERβrdma_get_cm_event(3)failed π (the underlying provider layer said no)RPMA_E_NOMEMβ out of memory π« (the classic)RPMA_E_NO_EVENTβ no next connection request available π (nothing in the queue, nobody's calling, the phone is silent, go touch grass)
fr fr, two different things can hand youRPMA_E_INVALβ aNULLep/req_ptr, OR an event that turned out to not be a connection request. don't assume which one it was. π§
β SEE ALSO β
rpma_conn_cfg_new(3)rpma_conn_req_delete(3)rpma_conn_req_connect(3)rpma_ep_listen(3)librpma(7)- <https://pmem.io/rpma/> β wait no, just
https://pmem.io/rpma/πΈ
go read those next, they're all connected, it's a whole cinematic universe. iykyk. π
RPMA β 01 April 2024 β and that's rpma_ep_next_conn_req(3), signing off π mwah, go handle your connection requests responsibly bestie πβ¨
π¦ where this page comes from
- ubuntu noble: librpma-dev 1.3.0-2build2 Β· BSD-3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms