From 6274913455be87cbe598b5d0534e1e80972c8efd Mon Sep 17 00:00:00 2001
From: gdamore The socket, or the endpoint, returned by these functions may be in the process of closing,
and might not be further usable as a result. (Other functions will result in The nng_dialer_id] or [nng_listener_id] for the re
NNG_ECLOSED.)Pipe Socket Addresses
+
+nng_err nng_pipe_peer_addr(nng_pipe p, nng_sockaddr *sap);
+nng_err nng_pipe_self_addr(nng_pipe p, nng_sockaddr *sap);
+nng_sockaddr for the local (self) or remote (peer) of the pipe is available using these
+functions. The associated address will be stored in the location pointed to by sap.Pipe Options
nng_err nng_pipe_get_bool(nng_pipe p, const char *opt, bool *valp);
nng_err nng_pipe_get_int(nng_pipe p, const char *opt, int *valp);
nng_err nng_pipe_get_ms(nng_pipe p, const char *opt, nng_duration *valp);
nng_err nng_pipe_get_size(nng_pipe p, const char *opt, size_t *valp);
-nng_err nng_pipe_get_addr(nng_pipe p, const char *opt, nng_sockaddr *valp);
nng_err nng_pipe_get_string(nng_pipe p, const char *opt, const char **valp);
nng_err nng_pipe_get_strcpy(nng_pipe p, const char *opt, char *val, size_t len);
nng_err nng_pipe_get_strdup(nng_pipe p, const char *opt, char **valp);
@@ -343,7 +348,6 @@ nng_err nng_pipe_get_strlen(nng_pipe p, const char *opt, size_t *lenp);
-
These functions are used to obtain value of an option named opt from the pipe p, and store it in the location
referenced by valp.
These functions access an option as a specific type. The transport layer will have details about which options @@ -368,7 +372,7 @@ typedef void (*nng_pipe_cb)(nng_pipe, nng_pipe_ev, void *); nng_err nng_pipe_notify(nng_socket s, nng_pipe_ev ev, nng_pipe_cb cb, void *arg); -
The nng_pipe_notify function registers the callback function cb
+
The nng_pipe_notify function registers the callback function cb
to be called whenever the pipe event specified by
ev occurs on the socket s.
The callback cb will be passed arg as its final argument.
The following pipe events are supported:
| Event | Description |
|---|---|
NNG_PIPE_EV_ADD_PRE | This event occurs after a connection and negotiation has completed, but before the pipe is added to the socket. If the pipe is closed (using nng_pipe_close) at this point, the socket will never see the pipe, and no further events will occur for the given pipe. |
NNG_PIPE_EV_ADD_POST | This event occurs after the pipe is fully added to the socket. Prior to this time, it is not possible to communicate over the pipe with the socket. |
NNG_PIPE_EV_REM_POST | This event occurs after the pipe has been removed from the socket. The underlying transport may be closed at this point, and it is not possible communicate using this pipe. |
NNG_PIPE_EV_ADD_PRE | This event occurs after a connection and negotiation has completed, but before the pipe is added to the socket. If the pipe is closed (using nng_pipe_close) at this point, the socket will never see the pipe, and no further events will occur for the given pipe. |
NNG_PIPE_EV_ADD_POST | This event occurs after the pipe is fully added to the socket. Prior to this time, it is not possible to communicate over the pipe with the socket. |
NNG_PIPE_EV_REM_POST | This event occurs after the pipe has been removed from the socket. The underlying transport may be closed at this point, and it is not possible communicate using this pipe. |
-- cgit v1.2.3-70-g09d2