'\" t
.\"     Title: nn_term
.\"    Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.17
.\"      Date: 2021-02-08
.\"    Manual: NNG Reference Manual
.\"    Source: \ \&
.\"  Language: English
.\"
.TH "NN_TERM" "3compat" "2021-02-08" "\ \&" "NNG Reference Manual"
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.ss \n[.ss] 0
.nh
.ad l
.de URL
\fI\\$2\fP <\\$1>\\$3
..
.als MTO URL
.if \n[.g] \{\
.  mso www.tmac
.  am URL
.    ad l
.  .
.  am MTO
.    ad l
.  .
.  LINKSTYLE blue R < >
.\}
.SH "NAME"
nn_term \- terminate library (compatible API)
.SH "SYNOPSIS"
.sp
.if n .RS 4
.nf
.fam C
#include <nanomsg/nn.h>

void nn_term(void);
.fam
.fi
.if n .RE
.SH "DESCRIPTION"
.sp
The \f(CRnn_term()\fP 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 \f(CREBADF\fP or \f(CRETERM\fP.
.if n .sp
.RS 4
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
.B Note
.ps -1
.br
.sp
This function is provided for API
compatibility with legacy \fIlibnanomsg\fP.
Consider using the relevant modern API instead.
.sp .5v
.RE
.if n .sp
.RS 4
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
.B Important
.ps -1
.br
.sp
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; for
example by registering this function with \f(CRatexit()\fP.
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.
.sp .5v
.RE
.SH "RETURN VALUES"
.sp
None.
.SH "ERRORS"
.sp
None.
.SH "SEE ALSO"
.sp
nn_errno(3compat),
nn_socket(3compat),
nng_compat(3compat),
nng(7)