aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2019-10-03 10:09:35 +0200
committerLoïc Hoguin <[email protected]>2019-10-03 10:09:35 +0200
commit99df823cc32fed641c15722e22e8d6a5969a77c6 (patch)
treeac7736e15986c1eb202a6d4c93ea44912eea184e /doc/src
parente4a535cfa6e27ac09c3f90b735748ad31cd78039 (diff)
downloadcowboy-99df823cc32fed641c15722e22e8d6a5969a77c6.tar.gz
cowboy-99df823cc32fed641c15722e22e8d6a5969a77c6.tar.bz2
cowboy-99df823cc32fed641c15722e22e8d6a5969a77c6.zip
Document stopping the listener in App:stop/1
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/guide/listeners.asciidoc15
1 files changed, 14 insertions, 1 deletions
diff --git a/doc/src/guide/listeners.asciidoc b/doc/src/guide/listeners.asciidoc
index 7701923..04169f9 100644
--- a/doc/src/guide/listeners.asciidoc
+++ b/doc/src/guide/listeners.asciidoc
@@ -75,7 +75,7 @@ start(_Type, _Args) ->
Dispatch = cowboy_router:compile([
{'_', [{"/", hello_handler, []}]}
]),
- {ok, _} = cowboy:start_tls(my_http_listener,
+ {ok, _} = cowboy:start_tls(my_https_listener,
[
{port, 8443},
{certfile, "/path/to/certfile"},
@@ -101,6 +101,19 @@ Cowboy 2.0 gets released.
Compatibility with HTTP/1.0 is provided by Cowboy's HTTP/1.1
implementation.
+=== Stopping the listener
+
+When starting listeners along with the application it is
+a good idea to also stop the listener when the application
+stops. This can be done by calling `cowboy:stop_listener/1`
+in the application's stop function:
+
+[source,erlang]
+----
+stop(_State) ->
+ ok = cowboy:stop_listener(my_http_listener).
+----
+
=== Protocol configuration
The HTTP/1.1 and HTTP/2 protocols share the same semantics;