#include <nanomsg/nn.h>
int nn_close(int sock);
--- version: tip layout: manpage_v2 title: nn_close(3compat) ---
nn_close - close socket (compatible API)
#include <nanomsg/nn.h>
int nn_close(int sock);
The nn_close() function closes the socket sock.
Any operations that are currently in progress will be terminated, and will
fail with error EBADF.
| This function is provided for API compatibility with legacy libnanomsg. Consider using the relevant modern API instead. |
This function returns zero on success, and -1 on failure.
EBADF
|
The socket is not open. |
ETERM
|
The library is shutting down. |