diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-05-21 15:51:08 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-05-21 21:27:16 -0700 |
| commit | d0cf8ce6f43daf6882037dbdcdaa7f2169dd1e6a (patch) | |
| tree | b6201f5f27c556b0a8102669605220fffccd4528 /tests/tcp.c | |
| parent | 45692d50c33f1fbc45554a5b82281046c4b3621a (diff) | |
| download | nng-d0cf8ce6f43daf6882037dbdcdaa7f2169dd1e6a.tar.gz nng-d0cf8ce6f43daf6882037dbdcdaa7f2169dd1e6a.tar.bz2 nng-d0cf8ce6f43daf6882037dbdcdaa7f2169dd1e6a.zip | |
fixes #469 SO_REUSEADDR should be enabled
fixes #468 TCP nodelay and keepalive should start usable
fixes #467 NN_RCVMAXSZ option does not work (compat)
fixes #465 Support NN_OPT_TCPNODELAY (compat)
This is a rather larger change set than I'd like, but when adding
support for legacy TCP keepalive, I found a number if issues using
the legacy TCP test (which we are introducing with this commit.)
This fixes the concerns that are relevant and addressible.
We have elected not to try to support to local address binding at this
time, and the IPv6 test case in the old code was wrong, so changes
relevant to that are commented out.
I've also updated the nng_compat manual page to reflect additional
caveats that folks should be aware of, including the previously
undocumented caveat around the NN_SNDBUF and NN_RCVBUF options.
Diffstat (limited to 'tests/tcp.c')
| -rw-r--r-- | tests/tcp.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/tcp.c b/tests/tcp.c index d29ceb8d..0018fce7 100644 --- a/tests/tcp.c +++ b/tests/tcp.c @@ -134,7 +134,8 @@ TestMain("TCP Transport", { So(nng_pair_open(&s) == 0); Reset({ nng_close(s); }); - So(nng_getopt_bool(s, NNG_OPT_TCP_NODELAY, &v) == NNG_ENOTSUP); + So(nng_getopt_bool(s, NNG_OPT_TCP_NODELAY, &v) == 0); + So(v == true); So(nng_dialer_create(&d, s, "tcp://127.0.0.1:4999") == 0); So(nng_dialer_getopt_bool(d, NNG_OPT_TCP_NODELAY, &v) == 0); So(v == true); @@ -183,8 +184,8 @@ TestMain("TCP Transport", { So(nng_pair_open(&s) == 0); Reset({ nng_close(s); }); - So(nng_getopt_bool(s, NNG_OPT_TCP_KEEPALIVE, &v) == - NNG_ENOTSUP); + So(nng_getopt_bool(s, NNG_OPT_TCP_KEEPALIVE, &v) == 0); + So(v == false); So(nng_dialer_create(&d, s, "tcp://127.0.0.1:4999") == 0); So(nng_dialer_getopt_bool(d, NNG_OPT_TCP_KEEPALIVE, &v) == 0); So(v == false); |
