aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/manual/ranch.set_protocol_options.asciidoc
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/manual/ranch.set_protocol_options.asciidoc')
-rw-r--r--doc/src/manual/ranch.set_protocol_options.asciidoc13
1 files changed, 13 insertions, 0 deletions
diff --git a/doc/src/manual/ranch.set_protocol_options.asciidoc b/doc/src/manual/ranch.set_protocol_options.asciidoc
index 1851fab..36370c8 100644
--- a/doc/src/manual/ranch.set_protocol_options.asciidoc
+++ b/doc/src/manual/ranch.set_protocol_options.asciidoc
@@ -18,6 +18,11 @@ Set the protocol options.
The change will be applied immediately for all new connections.
Old connections will not receive the new options.
+Note that the complete set of protocol options is replaced. To update a subset
+of the options, it is recommended to get the current protocol options using
+link:man:ranch:get_protocol_options(3)[ranch:get_protocol_options(3)], update
+them and then set them back using this function.
+
== Arguments
Ref::
@@ -40,6 +45,14 @@ The atom `ok` is always returned. It can be safely ignored.
ranch:set_protocol_options(example, ProtoOpts).
----
+.Update some of the protocol options
+[source,erlang]
+----
+ProtoOpts0 = ranch:get_protocol_options(example),
+ProtoOpts = ProtoOpts0#{request_timeout => 2000},
+ranch:set_protocol_options(example, ProtoOpts).
+----
+
== See also
link:man:ranch:get_protocol_options(3)[ranch:get_protocol_options(3)],