From 249932f3a208260f6b9c99d778b22d51cfabe87b Mon Sep 17 00:00:00 2001
From: Garrett D'Amore <garrett@damore.org>
Date: Sun, 15 Nov 2020 17:47:54 -0800
Subject: 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.
---
 docs/man/nng_options.5.adoc | 8 ++++++++
 1 file changed, 8 insertions(+)

(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 fa78453c..eb1c873b 100644
--- a/docs/man/nng_options.5.adoc
+++ b/docs/man/nng_options.5.adoc
@@ -196,6 +196,14 @@ per-dialer or per-listener basis.
 IMPORTANT: Applications on hostile networks should set this to a non-zero
 value to prevent denial-of-service attacks.
 +
+IMPORTANT: This option should be set before any listeners or dialers are added.
+Ideally this option should be set on specific dialers or listeners; setting it
+on the socket globally is deprecated behavior, and might not work in a future release,
+or might only work for endpoints that have not yet been created.
+(Maximum receive sizes might be negotiated during connection establishment for
+future transports, which means that the option needs to be set before any connections
+are established.)
++
 NOTE: Some transports may have further message size restrictions.
 
 [[NNG_OPT_RECVTIMEO]]
-- 
cgit v1.2.3-70-g09d2

