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/platform/posix/posix_tcpconn.c | |
| 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/platform/posix/posix_tcpconn.c')
| -rw-r--r-- | src/platform/posix/posix_tcpconn.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/platform/posix/posix_tcpconn.c b/src/platform/posix/posix_tcpconn.c index 3c8c3715..9684fe27 100644 --- a/src/platform/posix/posix_tcpconn.c +++ b/src/platform/posix/posix_tcpconn.c @@ -463,14 +463,14 @@ static const nni_option tcp_options[] = { }; static int -tcp_getx(void *arg, const char *name, void *buf, size_t *szp, nni_type t) +tcp_get(void *arg, const char *name, void *buf, size_t *szp, nni_type t) { nni_tcp_conn *c = arg; return (nni_getopt(tcp_options, name, c, buf, szp, t)); } static int -tcp_setx(void *arg, const char *name, const void *buf, size_t sz, nni_type t) +tcp_set(void *arg, const char *name, const void *buf, size_t sz, nni_type t) { nni_tcp_conn *c = arg; return (nni_setopt(tcp_options, name, c, buf, sz, t)); @@ -495,8 +495,8 @@ nni_posix_tcp_alloc(nni_tcp_conn **cp, nni_tcp_dialer *d) c->stream.s_close = tcp_close; c->stream.s_recv = tcp_recv; c->stream.s_send = tcp_send; - c->stream.s_getx = tcp_getx; - c->stream.s_setx = tcp_setx; + c->stream.s_get = tcp_get; + c->stream.s_set = tcp_set; *cp = c; return (0); |
