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 /src/transport/tls | |
| 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 'src/transport/tls')
| -rw-r--r-- | src/transport/tls/tls.c | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/transport/tls/tls.c b/src/transport/tls/tls.c index 69e36609..a852ddd8 100644 --- a/src/transport/tls/tls.c +++ b/src/transport/tls/tls.c @@ -54,7 +54,6 @@ struct nni_tls_ep { nni_plat_tcp_ep *tep; uint16_t proto; size_t rcvmax; - nni_duration linger; int authmode; nni_aio * aio; nni_aio * user_aio; @@ -819,26 +818,6 @@ nni_tls_ep_getopt_recvmaxsz(void *arg, void *v, size_t *szp, int typ) } static int -nni_tls_ep_setopt_linger(void *arg, const void *v, size_t sz, int typ) -{ - nni_tls_ep * ep = arg; - nng_duration val; - int rv; - - if (((rv = nni_copyin_ms(&val, v, sz, typ)) == 0) && (ep != NULL)) { - ep->linger = val; - } - return (rv); -} - -static int -nni_tls_ep_getopt_linger(void *arg, void *v, size_t *szp, int typ) -{ - nni_tls_ep *ep = arg; - return (nni_copyout_ms(ep->linger, v, szp, typ)); -} - -static int tls_setopt_config(void *arg, const void *data, size_t sz, int typ) { nni_tls_ep * ep = arg; @@ -984,12 +963,6 @@ static nni_tran_ep_option nni_tls_ep_options[] = { .eo_setopt = nni_tls_ep_setopt_recvmaxsz, }, { - .eo_name = NNG_OPT_LINGER, - .eo_type = NNI_TYPE_DURATION, - .eo_getopt = nni_tls_ep_getopt_linger, - .eo_setopt = nni_tls_ep_setopt_linger, - }, - { .eo_name = NNG_OPT_URL, .eo_type = NNI_TYPE_STRING, .eo_getopt = nni_tls_ep_getopt_url, |
