summaryrefslogtreecommitdiff
path: root/src/libskabus/skabus_pub_sendv_async.c
blob: 8f4e6e0b311a5a5a6ad6cf9c381d38908690fa97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* ISC license. */

#include <sys/uio.h>

#include <skalibs/unixmessage.h>
#include <skalibs/skaclient.h>

#include <skabus/pub.h>
#include "skabus-pub-internal.h"

int skabus_pub_sendv_withfds_async (skabus_pub_t *a, struct iovec const *v, unsigned int vlen, int const *fds, unsigned int nfds, unsigned char const *bits, skabus_pub_send_result_t *result)
{
  struct iovec vv[vlen+1] ;
  unixmessagev m = { .v = vv, .vlen = vlen+1, .fds = (int *)fds, .nfds = nfds } ;
  vv[0].iov_base = "!" ; vv[0].iov_len = 1 ;
  for (unsigned int i = 0 ; i < vlen ; i++) vv[1+i] = v[i] ;
  return skaclient_putmsgv_and_close(&a->connection, &m, bits, &skabus_pub_send_cb, result) ;
}