1NN_SHUTDOWN(3) nanomsg 1.1.5 NN_SHUTDOWN(3)
2
3
4
6 nn_shutdown - remove an endpoint from a socket
7
9 #include <nanomsg/nn.h>
10
11 int nn_shutdown (int s, int how);
12
14 Removes an endpoint from socket s. how parameter specifies the ID of
15 the endpoint to remove as returned by prior call to nn_bind(3) or
16 nn_connect(3). nn_shutdown() call will return immediately, however, the
17 library will try to deliver any outstanding outbound messages to the
18 endpoint for the time specified by NN_LINGER socket option.
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 EBADF
26 The provided socket is invalid.
27
28 EINVAL
29 The how parameter doesn’t correspond to an active endpoint.
30
31 EINTR
32 Operation was interrupted by a signal. The endpoint is not fully
33 closed yet. Operation can be re-started by calling nn_shutdown()
34 again.
35
36 ETERM
37 The library is terminating.
38
40 s = nn_socket (AF_SP, NN_PUB);
41 eid = nn_bind (s, "inproc://test");
42 nn_shutdown (s, eid);
43
45 nn_socket(3) nn_bind(3) nn_connect(3) nanomsg(7)
46
48 Martin Sustrik <sustrik@250bpm.com>
49
50
51
52 2022-07-22 NN_SHUTDOWN(3)