From 5dfd550c68284438aeaacbaef815fc7d2f75f068 Mon Sep 17 00:00:00 2001
From: Garrett D'Amore <garrett@damore.org>
Date: Sat, 14 Apr 2018 12:46:15 -0700
Subject: 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*.
---
 docs/man/nng_options.5.adoc | 14 --------------
 1 file changed, 14 deletions(-)

(limited to 'docs/man/nng_options.5.adoc')

diff --git a/docs/man/nng_options.5.adoc b/docs/man/nng_options.5.adoc
index b5b62815..d71a7b54 100644
--- a/docs/man/nng_options.5.adoc
+++ b/docs/man/nng_options.5.adoc
@@ -21,7 +21,6 @@ nng_options - socket, dialer, listener, and pipe options
 
 #define NNG_OPT_SOCKNAME   "socket-name"
 #define NNG_OPT_RAW        "raw"
-#define NNG_OPT_LINGER     "linger"
 #define NNG_OPT_RECVBUF    "recv-buffer"
 #define NNG_OPT_SENDBUF    "send-buffer"
 #define NNG_OPT_RECVFD     "recv-fd"
@@ -73,19 +72,6 @@ can have multiple dialers and endpoints associated with them.
 An attempt has been made to include details about such restrictions in the
 description of the option.
 
-[[NNG_OPT_LINGER]]
-((`NNG_OPT_LINGER`))::
-(((lingering)))
-(`<<nng_duration.5#,nng_duration>>`)
-This is the linger time of the socket in milliseconds.
-When this value is non-zero, then the system will
-attempt to defer closing until it has undelivered data, or until the specified
-timeout has expired.
-
-NOTE: Not all transports support lingering, and
-so closing a socket or exiting the application can still result in the loss
-of undelivered messages.
-
 [[NNG_OPT_LOCADDR]]
 ((`NNG_OPT_LOCADDR`))::
 (`<<nng_sockaddr.5#,nng_sockaddr>>`)
-- 
cgit v1.2.3-70-g09d2

