RDMA_LISTEN(3)

πŸ’– RDMA_LISTEN(3) πŸ’–

okay bestie, welcome to the librdmacm programmer's manual, and today's main character is rdma_listen β€” the one from <rdma/rdma_cma.h>. grab a boba, we're doing networking πŸ§‹βœ¨


✨ NAME ✨

rdma_listen β€” it's literally just sitting there, waiting for people to slide into your DMs. listen for incoming connection requests, periodt.


🌸 SYNOPSIS 🌸

#include <rdma/rdma_cma.h>

int rdma_listen (struct rdma_cm_id *id, int backlog);

πŸŽ€ ARGUMENTS πŸŽ€

  • id β€” the RDMA identifier. it's giving "this is me, this is my address" πŸ’…
  • backlog β€” the backlog of incoming connection requests. basically how many besties can be queued up waiting outside your door before it gets awkward.

πŸ¦‹ DESCRIPTION πŸ¦‹

so what does it actually do? it initiates a listen for incoming connection requests, or for datagram service lookup. that's the whole vibe. πŸ‘‘

and here's the key deets: the listen is restricted to the locally bound source address. so it's not listening to the whole entire world, it's listening to your address specifically. very main character of it, ngl.


πŸ’œ RETURN VALUE πŸ’œ

  • returns 0 on success ✨ (we love a clean win)
  • returns -1 on error 😭

and if an error happens? errno gets set to indicate the failure reason. so if something goes wrong, don't just stand there β€” go check errno, she's trying to tell you something.


πŸ”₯ NOTES πŸ”₯

heads up bestie, this part matters a LOT.

users must have bound the rdma_cm_id to a local address by calling rdma_bind_addr before calling this routine. no bind, no listen. that's the rule. fr fr.

and the way it behaves depends on how you bound it:

  • if the rdma_cm_id is bound to a specific IP address, the listen will be restricted to that address and the associated RDMA device. locked in, exclusive, no sharing. πŸ’…
  • if the rdma_cm_id is bound to an RDMA port number only, the listen will occur across all RDMA devices. she's everywhere, she's in her era, no cap. 🌈

🌟 SEE ALSO 🌟


okay that's the whole page, you ate that 🫢 this one's from <strong>librdmacm</strong>, dated <strong>2007-05-15</strong> β€” yes she's an icon from 2007 and she still serves, we love a vintage queen πŸ‘‘πŸ’– bye bestie!!

πŸ“¦ where this page comes from