'\" t .\" Title: nn_close .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.20 .\" Date: 2024-02-21 .\" Manual: nanomsg 1.2.1 .\" Source: \ \& .\" Language: English .\" .TH "NN_CLOSE" "3" "2024-02-21" "\ \&" "nanomsg 1.2.1" .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_close \- close an SP socket .SH "SYNOPSIS" .sp \fB#include \fP .sp \fBint nn_close (int \fIs\fP);\fP .SH "DESCRIPTION" .sp Closes the socket \fIs\fP. Any buffered inbound messages that were not yet received by the application will be discarded. The library will try to deliver any outstanding outbound messages for the time specified by \fINN_LINGER\fP socket option. The call will block in the meantime. .SH "RETURN VALUE" .sp If the function succeeds zero is returned. Otherwise, \-1 is returned and \fIerrno\fP is set to to one of the values defined below. .SH "ERRORS" .sp \fBEBADF\fP .RS 4 The provided socket is invalid. .RE .sp \fBEINTR\fP .RS 4 Operation was interrupted by a signal. The socket is not fully closed yet. Operation can be re\-started by calling \fInn_close()\fP again. .RE .SH "EXAMPLE" .sp .if n .RS 4 .nf .fam C int s = nn_socket (AF_SP, NN_PUB); assert (s >= 0); int rc = nn_close (s); assert (rc == 0); .fam .fi .if n .RE .SH "SEE ALSO" .sp nn_socket(3) nn_setsockopt(3) nanomsg(7) .SH "AUTHORS" .sp .MTO "sustrik\(at250bpm.com" "Martin Sustrik" ""