diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-04-14 12:46:15 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-04-14 12:46:15 -0700 |
| commit | 5dfd550c68284438aeaacbaef815fc7d2f75f068 (patch) | |
| tree | f6e1d0139e673f133cdcc4114977f5b67689c80d /tests/sock.c | |
| parent | c66ef25c7dfd0c2a3c4a8aa8eea223fa186c2311 (diff) | |
| download | nng-5dfd550c68284438aeaacbaef815fc7d2f75f068.tar.gz nng-5dfd550c68284438aeaacbaef815fc7d2f75f068.tar.bz2 nng-5dfd550c68284438aeaacbaef815fc7d2f75f068.zip | |
fixes #308 Close can block
Ultimately, this just removes the support for lingering altogether.
Based on prior experience, lingering has always been unreliable, and
was removed in legacy libnanomsg ages ago.
The problem is that operating system support for lingering is very
inconsistent at best, and for some transports the very concept is somewhat
meaningless.
Making things worse, we were never able to adequately capture an exit()
event from another thread -- so lingering was always a false promise.
Applications that need to be sure that messages are delivered should
either include an ack in their protocol, use req/rep (which has an ack),
or inject a suitable delay of their own.
For things going over local networks, an extra delay of 100 msec should
be sufficient *most of the time*.
Diffstat (limited to 'tests/sock.c')
| -rw-r--r-- | tests/sock.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/sock.c b/tests/sock.c index c4de6ad4..17ea055d 100644 --- a/tests/sock.c +++ b/tests/sock.c @@ -471,10 +471,10 @@ TestMain("Socket Operations", { So(nng_listener_getopt_int(1999, NNG_OPT_RAW, &i) == NNG_ENOENT); - So(nng_dialer_getopt_ms(1999, NNG_OPT_LINGER, &t) == - NNG_ENOENT); - So(nng_listener_getopt_ms(1999, NNG_OPT_LINGER, &t) == + So(nng_dialer_getopt_ms(1999, NNG_OPT_RECVTIMEO, &t) == NNG_ENOENT); + So(nng_listener_getopt_ms( + 1999, NNG_OPT_SENDTIMEO, &t) == NNG_ENOENT); }); |
