aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/manual/ranch.suspend_listener.asciidoc
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/manual/ranch.suspend_listener.asciidoc')
-rw-r--r--doc/src/manual/ranch.suspend_listener.asciidoc62
1 files changed, 62 insertions, 0 deletions
diff --git a/doc/src/manual/ranch.suspend_listener.asciidoc b/doc/src/manual/ranch.suspend_listener.asciidoc
new file mode 100644
index 0000000..322b993
--- /dev/null
+++ b/doc/src/manual/ranch.suspend_listener.asciidoc
@@ -0,0 +1,62 @@
+= ranch:suspend_listener(3)
+
+== Name
+
+ranch:suspend_listener - Suspend a running listener
+
+== Description
+
+[source,erlang]
+----
+suspend_listener(Ref :: ranch_ref())
+ -> ok | {error, any()}
+----
+
+Suspend a running listener.
+
+Ranch will stop listening for and accepting connections and
+the listening socket will be closed. Existing connections
+will continue undisturbed. The function
+link:man:ranch:wait_for_connections(3)[ranch:wait_for_connections(3)]
+can be used to wait for connections to be closed if necessary.
+
+Some transport options can only be changed when the listener is
+suspended. Please consult the
+link:man:ranch:set_transport_options(3)[ranch:set_transport_options(3)]
+manual for more information.
+
+Nothing is done when the listener is already suspended.
+
+== Arguments
+
+Ref::
+
+The listener name.
+
+== Return value
+
+The atom `ok` is returned on success.
+
+An error tuple is returned when the listener could not be suspended.
+
+== Changelog
+
+* *1.6*: Function introduced.
+
+== Examples
+
+.Suspend a listener
+[source,erlang]
+----
+ok = ranch:suspend_listener(example).
+----
+
+== See also
+
+link:man:ranch:start_listener(3)[ranch:start_listener(3)],
+link:man:ranch:stop_listener(3)[ranch:stop_listener(3)],
+link:man:ranch:resume_listener(3)[ranch:resume_listener(3)],
+link:man:ranch:get_status(3)[ranch:get_status(3)],
+link:man:ranch:set_transport_options(3)[ranch:set_transport_options(3)],
+link:man:ranch:wait_for_connections(3)[ranch:wait_for_connections(3)],
+link:man:ranch(3)[ranch(3)]