1NN_FREEMSG(3) nanomsg 1.1.5 NN_FREEMSG(3)
2
3
4
6 nn_freemsg - deallocate a message
7
9 #include <nanomsg/nn.h>
10
11 int nn_freemsg (void *msg);
12
14 Deallocates a message allocated using nn_allocmsg(3) function or
15 received via nn_recv(3) or nn_recvmsg(3) function. While nn_recv(3) and
16 nn_recvmsg(3) allow to receive data into arbitrary buffers, using
17 library-allocated buffers can be more efficient for large messages as
18 it allows for using zero-copy techniques.
19
21 If the function succeeds zero is returned. Otherwise, -1 is returned
22 and errno is set to to one of the values defined below.
23
25 EFAULT
26 The message pointer is invalid.
27
29 void *buf;
30 nn_recv (s, &buf, NN_MSG, 0);
31 nn_freemsg (buf);
32
34 nn_allocmsg(3) nn_reallocmsg(3) nn_recv(3) nn_recvmsg(3) nanomsg(7)
35
37 Martin Sustrik <sustrik@250bpm.com>
38
39
40
41 2021-07-22 NN_FREEMSG(3)