1NN_CLOSE(3) nanomsg 1.1.5 NN_CLOSE(3)
2
3
4
6 nn_close - close an SP socket
7
9 #include <nanomsg/nn.h>
10
11 int nn_close (int s);
12
14 Closes the socket s. Any buffered inbound messages that were not yet
15 received by the application will be discarded. The library will try to
16 deliver any outstanding outbound messages for the time specified by
17 NN_LINGER socket option. The call will block in the meantime.
18
20 If the function succeeds zero is returned. Otherwise, -1 is returned
21 and errno is set to to one of the values defined below.
22
24 EBADF
25 The provided socket is invalid.
26
27 EINTR
28 Operation was interrupted by a signal. The socket is not fully
29 closed yet. Operation can be re-started by calling nn_close()
30 again.
31
33 int s = nn_socket (AF_SP, NN_PUB);
34 assert (s >= 0);
35 int rc = nn_close (s);
36 assert (rc == 0);
37
39 nn_socket(3) nn_setsockopt(3) nanomsg(7)
40
42 Martin Sustrik <sustrik@250bpm.com>
43
44
45
46 2022-07-22 NN_CLOSE(3)