aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/guide/ws_handlers.asciidoc
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-01-29 13:03:42 +0100
committerLoïc Hoguin <[email protected]>2018-01-29 13:03:42 +0100
commit50fd64ec34abd6e8555a6c6cb08988f9353bf318 (patch)
tree5ea9640cef1dfea5f41855a01bdd3020a5f82583 /doc/src/guide/ws_handlers.asciidoc
parentd27a373bc35d54e545d00942ada746c3e2ba497b (diff)
downloadcowboy-50fd64ec34abd6e8555a6c6cb08988f9353bf318.tar.gz
cowboy-50fd64ec34abd6e8555a6c6cb08988f9353bf318.tar.bz2
cowboy-50fd64ec34abd6e8555a6c6cb08988f9353bf318.zip
Add an example with a Websocket close frame
Thanks benbro!
Diffstat (limited to 'doc/src/guide/ws_handlers.asciidoc')
-rw-r--r--doc/src/guide/ws_handlers.asciidoc8
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/src/guide/ws_handlers.asciidoc b/doc/src/guide/ws_handlers.asciidoc
index a79d7e2..c944606 100644
--- a/doc/src/guide/ws_handlers.asciidoc
+++ b/doc/src/guide/ws_handlers.asciidoc
@@ -267,3 +267,11 @@ Sending a `close` frame will immediately initiate the closing
of the Websocket connection. Note that when sending a list of
frames that include a close frame, any frame found after the
close frame will not be sent.
+
+The following example sends a close frame with a reason message:
+
+[source,erlang]
+----
+websocket_info(_Info, State) ->
+ {reply, {close, 1000, <<"some-reason">>}, State}.
+----