From 0ea2fdfcab92d273f4db8bd4d24bb2639763155c Mon Sep 17 00:00:00 2001
From: gdamore
typedef struct nng_stream nng_stream`
+typedef struct nng_stream nng_stream
The base nng_stream type represents a bidirectional, byte-oriented, reliable connection.
@@ -3132,7 +3132,7 @@ using these Streams APIs.
The nng_stream object is used for raw byte stream connections, and
should not be confused with a pipe object created on a socket using
-the [nng_listen], [nng_dial] or related functions.
+the nng_listen, nng_dial or related functions.
Sending and Receiving Data
void nng_stream_send(nng_stream *s, nng_aio *aio);
@@ -3176,6 +3176,28 @@ stream itself.
or be aborted, these functions are unsafe to call from functions that may not block, such as the
completion function registered with an nng_aio when it is created.
+Getting Stream Options
+int nng_stream_get_bool(nng_stream *s, const char *opt, bool *valp);
+int nng_stream_get_int(nng_stream *s, const char *opt, int *valp);
+int nng_stream_get_ms(nng_stream *s, const char *opt, nng_duration *valp);
+int nng_stream_get_size(nng_stream *s, const char *opt, size_t *valp);
+int nng_stream_get_addr(nng_stream *s, const char *opt, nng_sockaddr *valp);
+int nng_stream_get_string(nng_stream *s, const char *opt, char **valp);
+int nng_stream_get_uint64(nng_stream *s, const char *opt, uint64_t *valp);
+
+
+
+
+
+
+
+
+These functions are used to obtain value of an option named opt from the stream s, 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
+are available, and which type they may be accessed using.
+In the case of nng_stream_get_string, the string is created as if by nng_strdup, and must be freed by
+the caller using nng_strfree when no longer needed.
@@ -6200,32 +6222,32 @@ NNG approach to messages. Likewise there is no struct nn_cmsghdr eq
nn_strerrornng_strerror
nn_errnoNone Errors are returned directly rather than through errno.
nn_socketVarious Use the appropriate protocol constructor, such as nng_req0_open.
-nn_closenng_socket_close
-nn_bindnng_listen, nng_listener_createAllocating a listener with nng_lister_create and configuring it offers more capabilities.
-nn_connectnng_dial, nng_dialer_createAllocating a dialer with nng_dialer_create and configuring it offers more capabilities.
-nn_shutdownnng_lister_close, nng_dialer_close
+nn_closenng_socket_close
+nn_bindnng_listen, nng_listener_createAllocating a listener with nng_lister_create and configuring it offers more capabilities.
+nn_connectnng_dial, nng_dialer_createAllocating a dialer with nng_dialer_create and configuring it offers more capabilities.
+nn_shutdownnng_listener_close, nng_dialer_close
nn_allocmsgnng_msg_allocThere are significant semantic differences.
nn_freemsgnng_msg_free
nn_reallocmsgnng_msg_realloc
-nn_sendnng_send
-nn_recvnng_recv
-nn_sendmsgnng_sendmsg
-nn_getsockoptnng_socket_getNNG has typed accessors for options, and also separate functions for dialers and listeners.
-nn_setsockoptnng_socket_set
-nn_devicenng_device
+nn_sendnng_send
+nn_recvnng_recv
+nn_sendmsgnng_sendmsg
+nn_getsockoptnng_socket_getNNG has typed accessors for options, and also separate functions for dialers and listeners.
+nn_setsockoptnng_socket_set
+nn_devicenng_device
nn_pollNone Can be constructed using nng_aio. Few if any applications ever used this API.
-nn_termNone The nng_fini API can do this, but is not recommended except when debugging memory leaks.
-nn_get_statisticnng_stats_getThe statistics in NNG are completely different, with different semantics and no stability guarantees.
+nn_termnng_finiThe nng_fini API can do this, but is not recommended except when debugging memory leaks.
+nn_get_statisticnng_stats_getThe statistics in NNG are completely different, with different semantics and no stability guarantees.
NN_POLLINNone Used only with nn_poll.
NN_POLLOUTNone Used only with nn_poll.
-NN_MSGNNG_FLAG_ALLOCSee nng_send and nng_recv for details.
+NN_MSGNNG_FLAG_ALLOCSee nng_send and nng_recv for details.
NN_CMSG_ALIGNNone
NN_CMSG_FIRSTHDRNone
NN_CMSG_NXTHDRNone
NN_CMSG_DATANone
NN_CMSG_LENNone
NN_CMSG_SPACENone
-struct nn_iovecnng_iov
+struct nn_iovecnng_iov
struct nn_msghdrnng_msg
struct nn_cmsghdrnng_msg and nng_msg_header
@@ -6234,12 +6256,12 @@ NNG approach to messages. Likewise there is no struct nn_cmsghdr eq
The following options are changed.
Nanomsg Option NNG Eqvaivalent Notes
NN_LINGERNone NNG does not support tuning this.
-NN_SNDBUFNNG_OPT_SENDBUFNNG value is given in messages, not bytes.
-NN_RCVBUFNNG_OPT_RECVBUFNNG value is given in messages, not bytes.
-NN_SNDTIMEONNG_OPT_SENDTIMEO
-NN_RCVTIMEONNG_OPT_RECVTIMEO
-NN_RECONNECT_IVLNNG_OPT_RECONNMINT
-NN_RECONNECT_IVL_MAXNNG_OPT_RECONNMAXT
+NN_SNDBUFNNG_OPT_SENDBUFNNG value is given in messages, not bytes.
+NN_RCVBUFNNG_OPT_RECVBUFNNG value is given in messages, not bytes.
+NN_SNDTIMEONNG_OPT_SENDTIMEO
+NN_RCVTIMEONNG_OPT_RECVTIMEO
+NN_RECONNECT_IVLNNG_OPT_RECONNMINT
+NN_RECONNECT_IVL_MAXNNG_OPT_RECONNMAXT
NN_SNDPRIONone Not supported in NNG yet.
NN_RCVPRIONone Not supported in NNG yet.
NN_RCVFDnng_socket_get_recv_poll_fdNo longer an option, use a function call.
@@ -6248,7 +6270,7 @@ NNG approach to messages. Likewise there is no struct nn_cmsghdr eq
NN_PROTOCOLnng_socket_proto_idNo longer an option. See also nng_socket_proto_name.
NN_IPV4ONLYNone Use URL such as tcp4:// to obtain this functionality.
NN_SOCKET_NAMENone Removed from NNG.
-NN_MAXTTLNNG_OPT_MAXTTL
+NN_MAXTTLNNG_OPT_MAXTTL
NN_SUB_SUBSCRIBEnng_sub0_socket_subscribeNo longer an option, use a function call.
NN_SUB_UNSUBSCRIBEnng_sub0_socket_unsubscribeNo longer an option, use a function call.
@@ -6281,7 +6303,7 @@ There are some exceptions. Be aware that the numeric values are not the
Local Addresses for Dialing
-The ability to specify the source address in the UROL,to use when
+
The ability to specify the source address in the URL,to use when
using nn_dial inside the URL is not present in NNG. The correct
way to specify the local address is using the NNG_OPT_LOCADDR option on the
dialer before starting to dial.
@@ -6489,6 +6511,13 @@ named pipes, 1
nng_stream, 1
nng_stream_close, 1
nng_stream_free, 1
+nng_stream_get_addr, 1
+nng_stream_get_bool, 1
+nng_stream_get_int, 1
+nng_stream_get_ms, 1
+nng_stream_get_size, 1
+nng_stream_get_string, 1
+nng_stream_get_uint64, 1
nng_stream_recv, 1
nng_stream_send, 1
nng_stream_stop, 1
--
cgit v1.2.3-70-g09d2