rpma_conn_disconnect(3)

πŸ“¦
version 1.3.0 Β· 3 versions
, in ubuntu noble

πŸ’– rpma_conn_disconnect β€” tear the connection down πŸ’–

okay bestie, welcome to the RPMA Programmer's Manual ✨ this one's rpma_conn_disconnect(3), and no cap, it's the breakup episode of the librpma saga πŸ’…


πŸŽ€ NAME πŸŽ€

rpma_conn_disconnect β€” tear the connection down

like. literally. that's the whole job. she serves closure πŸ¦‹


✨ SYNOPSIS ✨

#include <librpma.h>

struct rpma_conn;
int rpma_conn_disconnect(struct rpma_conn *conn);

so you grab librpma.h, you've got your struct rpma_conn floating around, and you call rpma_conn_disconnect() on it with a pointer to your conn. that's the move 🫢


🌸 DESCRIPTION 🌸

rpma_conn_disconnect() tears the connection down. that's it. that's the vibe. it's giving "we need to talk" but make it RDMA 😭

the way it works is, there are two whole moods it can be in:

  • It may initiate disconnecting the connection. in that case, the end of disconnecting is signalled by the RPMA_CONN_CLOSED event via rpma_conn_next_event() β€” so you don't just get closure, you get a notification that closure happened πŸ‘‘
  • It may be called after receiving the RPMA_CONN_CLOSED event. in this case, the disconnection is done when rpma_conn_disconnect() returns with success. so if you already got the event, the moment this call comes back good, it's over over. periodt πŸ’€

πŸ’œ RETURN VALUE πŸ’œ

rpma_conn_disconnect() returns 0 on success or a negative error code on failure.

zero = slay, negative = not slay πŸ™ˆ


πŸ”₯ ERRORS πŸ”₯

rpma_conn_disconnect() can fail with the following errors, and bestie you will be checking these:

  • RPMA_E_INVAL β€” conn is NULL πŸ’€ like girl. you passed nothing. there's no connection to tear down. what are we doing
  • RPMA_E_PROVIDER β€” rdma_disconnect() failed 😭 the underlying provider said no
fr fr, always check the return value. a silent failed disconnect is main character energy in the worst possible way.

🌈 SEE ALSO 🌈


RPMA Β· version vibes from the RPMA Programmer's Manual, dated 01 April 2024 β€” that's the tea, bestie, go disconnect responsibly πŸŽ€βœ¨πŸ’–

πŸ“¦ where this page comes from