QB_IPCC_SENDV_RECV(3)

πŸ’– qb_ipcc_sendv_recv β€” the libqb programmer's manual, but make it make sense πŸ’–

okay bestie so you're reading the libqb Programmer's Manual and the star of today's episode is qb_ipcc_sendv_recv(3). yes it's a mouthful. no we are not changing it. let's go πŸ¦‹


✨ NAME ✨

qb_ipcc_sendv_recv β€” this is a convenience function that simply sends and then recvs.

that's it. that's the whole vibe. it sends, then it recvs. no cap. πŸ’…


🌸 SYNOPSIS 🌸

#include <qb/qbipcc.h>

ssize_t qb_ipcc_sendv_recv(
    qb_ipcc_connection_t   *c,           /* connection instance */
    const struct iovec     *iov,         /* pointer to an iovec struct to send */
    uint32_t                iov_len,     /* the number of iovecs used */
    void                   *msg_ptr,     /* pointer to a message buffer to receive into */
    size_t                  msg_len,     /* the size of the buffer */
    int32_t                 ms_timeout   /* max time to wait for a response*/
);

look at her. six params. she's serving. πŸ‘‘


πŸŽ€ PARAMS πŸŽ€

  • c β€” your connection instance. the main character of this whole operation, honestly.
  • iov β€” pointer to an iovec struct to send. the actual goods you're shipping out πŸ“¦
  • iov_len β€” the number of iovecs used. like, how many of them. count them. don't lie.
  • msg_ptr β€” pointer to a message buffer to receive into. this is where the reply lands 🫢
  • msg_len β€” the size of the buffer. gotta know how much room the reply gets.
  • ms_timeout β€” max time to wait for a response. in milliseconds. the patience budget ⏳

πŸ’« DESCRIPTION πŸ’«

okay so picture this: you've got a connection, you've got a pile of iovecs, and you're like "bestie, I need to send this AND get the reply back." normally that's two separate calls and two separate little brain cells dedicated to keeping track of them. not anymore.

this function is a convenience function. it simply sends and then recvs. that's the entire personality. it's giving "why do it in two steps when one step slays" ✨

you hand it your connection instance in c, the iovecs you want out the door in iov, how many of them in iov_len, a buffer to receive into in msg_ptr, the size of that buffer in msg_len, and a max wait time in ms_timeout. it handles the send-then-receive choreography so you don't have to. iconique. πŸ’…


πŸ™ˆ NOTE πŸ™ˆ

bestie. listen. this one matters. msg_ptr will include a qb_ipc_response_header at the top of the message.

so like. the header is at the top. of the message. that you receive into msg_ptr. do not act surprised when you see it there. it was always going to be there. plan your buffer and your parsing accordingly, okay? 😭


πŸ”₯ SEE ALSO πŸ”₯

the whole friend group showed up, and they all ate:

iykyk 🧚


Copyright (C) 2010-2020 Red Hat, Inc.


libqb Β· page date 2025-09-16 Β· originally filed under QB_IPCC_SENDV_RECV(3)

okay that's the whole page bestie, go forth and send-then-recv responsibly 🌈✨ bye πŸ’–

πŸ“¦ where this page comes from