From 03fabdf697d1fd19708d8c8a618c7ecb712ae64e Mon Sep 17 00:00:00 2001
From: gdamore The
+
+ note
+ Closing a socket also invalidates any dialers, listeners,
+pipes, or contexts associated with it.
+
+ note
+ This function will wait for any outstanding operations to be aborted, or to complete,
+before returning. Consequently it is not safe to call this from contexts that cannot
+block.
+
+ note
+ Closing the socket may be disruptive to transfers that are still in progress. Sometimes it is necessary to integrate a socket into a nng_sub0_open_raw - SUB version 0, raw mode
nng_surveyor0_open_raw - SURVEYOR version 0, raw modeClosing a Socket
+
+int nng_socket_close(nng_socket s);
+nng_socket_close function closes a socket, releasing all resources
+associated with it. Any operations that are in progress will be terminated with
+a result of NNG_ECLOSED.Polling Socket Events
int nng_socket_get_recv_poll_fd(nng_socket s, int *fdp);
int nng_socket_get_send_poll_fd(nng_socket s, int *fdp);
poll or select driven
-event loop. (Or, on Linux, epoll, or on BSD derived systems like macOS kqueue).epoll, or on BSD derived systems like macOS kqueue).
For these occasions, a suitable file descriptor for polling is provided by these two functions.
-The nng_socket_get_recv_poll_fd function obtains a file descriptor
+
The nng_socket_get_recv_poll_fd function obtains a file descriptor
that will poll as readable when a message is ready for receiving for the socket.
The nng_socket_get_send_poll_fd function obtains a file descriptor
+
The nng_socket_get_send_poll_fd function obtains a file descriptor
that will poll as readable when the socket can accept a message for sending.
These file descriptors should only be polled for readability, and no other operation performed on them. The socket will read from, or write to, -- cgit v1.2.3-70-g09d2