blob: 45ffa7026e676a2ceeecd117e11701540cfb25f3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
## nn_term
Terminate library (compatible API).
### Synopsis
```c
#include <nanomsg/nn.h>
void nn_term(void);
```
### Description
The `nn_term` function closes any open sockets, and frees all resources allocated by the library.
Any operations that are currently in progress will be terminated, and will fail with error `EBADF` or `ETERM`.
IMPORTANT: This function is not thread-safe, and is not suitable for use in library calls.
The intended purpose of this is to clean up at application termination.
This can help prevent false leak reports caused when memory checkers notice global resources allocated by the library.
Libraries should never use this function, but should explicitly close their own sockets directly.
### See Also
xref:nn_errno.adoc[nn_errno],
xref:nn_socket.adoc[nn_socket]
|