suspend_listener(Ref :: ranch_ref()) -> ok | {error, any()}
ranch:suspend_listener - Suspend a running listener
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 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 ranch:set_transport_options(3) manual for more information.
Nothing is done when the listener is already suspended.
The listener name.
The atom ok
is returned on success.
An error tuple is returned when the listener could not be suspended.
ok = ranch:suspend_listener(example).
ranch:start_listener(3), ranch:stop_listener(3), ranch:resume_listener(3), ranch:get_status(3), ranch:set_transport_options(3), ranch:wait_for_connections(3), ranch(3)
Donate to Loïc Hoguin because his work on Cowboy, Ranch, Gun and Erlang.mk is fantastic:
Recurring payment options are also available via GitHub Sponsors. These funds are used to cover the recurring expenses like food, dedicated servers or domain names.