diff options
author | Viktor Söderqvist <[email protected]> | 2020-12-03 09:34:57 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2020-12-04 11:49:19 +0100 |
commit | 4a1d16242c6fa9865fd7499d301d90b9ca65d6b1 (patch) | |
tree | 5f5547749f3a79763313470fe582996c0216264b /doc/src/manual/ranch.set_protocol_options.asciidoc | |
parent | 3e914c44a4e956c3b6ef3c1ffc64aac1fca46be9 (diff) | |
download | ranch-4a1d16242c6fa9865fd7499d301d90b9ca65d6b1.tar.gz ranch-4a1d16242c6fa9865fd7499d301d90b9ca65d6b1.tar.bz2 ranch-4a1d16242c6fa9865fd7499d301d90b9ca65d6b1.zip |
Clarify {get,set}_{protocol,transport}_options docs
Clarifications and examples.
Diffstat (limited to 'doc/src/manual/ranch.set_protocol_options.asciidoc')
-rw-r--r-- | doc/src/manual/ranch.set_protocol_options.asciidoc | 13 |
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)], |