diff options
| author | Garrett D'Amore <garrett@damore.org> | 2020-11-15 17:47:54 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2020-11-15 17:47:54 -0800 |
| commit | 249932f3a208260f6b9c99d778b22d51cfabe87b (patch) | |
| tree | 4fd4826127e9c225d5232c39d4ae1db89b539689 /src/core/stream.h | |
| parent | eb328da56c3fc7167b536dcb206df0abb0f4a9b9 (diff) | |
| download | nng-249932f3a208260f6b9c99d778b22d51cfabe87b.tar.gz nng-249932f3a208260f6b9c99d778b22d51cfabe87b.tar.bz2 nng-249932f3a208260f6b9c99d778b22d51cfabe87b.zip | |
fixes #1071 tran_chkopt can be cleaned up
This is a sweeping cleanup of the transport logic around options,
and also harmonizes the names used when setting or getting options.
Additionally, legacy methods are now moved into a separate file and
can be elided via CMake or a preprocessor define.
Fundamentally, the ability to set to transport options via the socket
is deprecated; there are numerous problems with this and my earlier
approaches to deal with this have been somewhat misguided. Further
these approaches will not work with future protocol work that is
planned (were some options need to be negotiated with peers at the
time of connection establishment.)
Documentation has been updated to reflect this. The test suites still
make rather broad use of the older APIs, and will be converted later.
Diffstat (limited to 'src/core/stream.h')
| -rw-r--r-- | src/core/stream.h | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/src/core/stream.h b/src/core/stream.h index 18914979..eb3cb93b 100644 --- a/src/core/stream.h +++ b/src/core/stream.h @@ -1,5 +1,5 @@ // -// Copyright 2019 Staysail Systems, Inc. <info@staysail.tech> +// Copyright 2020 Staysail Systems, Inc. <info@staysail.tech> // // This software is supplied under the terms of the MIT License, a // copy of which should be located in the distribution where this @@ -16,24 +16,21 @@ #include "core/nng_impl.h" // Private property operations (these include the types.) -extern int nni_stream_getx( +extern int nni_stream_get( nng_stream *, const char *, void *, size_t *, nni_type); -extern int nni_stream_setx( +extern int nni_stream_set( nng_stream *, const char *, const void *, size_t, nni_type); -extern int nni_stream_dialer_getx( +extern int nni_stream_dialer_get( nng_stream_dialer *, const char *, void *, size_t *, nni_type); -extern int nni_stream_dialer_setx( +extern int nni_stream_dialer_set( nng_stream_dialer *, const char *, const void *, size_t, nni_type); -extern int nni_stream_listener_getx( +extern int nni_stream_listener_get( nng_stream_listener *, const char *, void *, size_t *, nni_type); -extern int nni_stream_listener_setx( +extern int nni_stream_listener_set( nng_stream_listener *, const char *, const void *, size_t, nni_type); -extern int nni_stream_checkopt( - const char *, const char *, const void *, size_t, nni_type); - // This is the common implementation of a connected byte stream. It should be // the first element of any implementation. Applications are not permitted to // access it directly. @@ -42,8 +39,8 @@ struct nng_stream { void (*s_close)(void *); void (*s_recv)(void *, nng_aio *); void (*s_send)(void *, nng_aio *); - int (*s_getx)(void *, const char *, void *, size_t *, nni_type); - int (*s_setx)(void *, const char *, const void *, size_t, nni_type); + int (*s_get)(void *, const char *, void *, size_t *, nni_type); + int (*s_set)(void *, const char *, const void *, size_t, nni_type); }; // Dialer implementation. Stream dialers create streams. @@ -51,8 +48,8 @@ struct nng_stream_dialer { void (*sd_free)(void *); void (*sd_close)(void *); void (*sd_dial)(void *, nng_aio *); - int (*sd_getx)(void *, const char *, void *, size_t *, nni_type); - int (*sd_setx)(void *, const char *, const void *, size_t, nni_type); + int (*sd_get)(void *, const char *, void *, size_t *, nni_type); + int (*sd_set)(void *, const char *, const void *, size_t, nni_type); }; // Listener implementation. Stream listeners accept connections and create @@ -62,8 +59,8 @@ struct nng_stream_listener { void (*sl_close)(void *); int (*sl_listen)(void *); void (*sl_accept)(void *, nng_aio *); - int (*sl_getx)(void *, const char *, void *, size_t *, nni_type); - int (*sl_setx)(void *, const char *, const void *, size_t, nni_type); + int (*sl_get)(void *, const char *, void *, size_t *, nni_type); + int (*sl_set)(void *, const char *, const void *, size_t, nni_type); }; #endif // CORE_STREAM_H |
