aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/guide/websocket.asciidoc
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/guide/websocket.asciidoc')
-rw-r--r--doc/src/guide/websocket.asciidoc17
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/src/guide/websocket.asciidoc b/doc/src/guide/websocket.asciidoc
index ba06e2c..31b014b 100644
--- a/doc/src/guide/websocket.asciidoc
+++ b/doc/src/guide/websocket.asciidoc
@@ -122,3 +122,20 @@ receive
handle_frame(ConnPid, StreamRef, Frame)
end.
----
+
+=== Automatic reconnect gotchas
+
+It is recommended to disable automatic reconnect when
+Websocket is used because Gun cannot automatically upgrade
+to Websocket on reconnect, and so an undetected disconnect
+may lead to many error messages from Gun.
+
+This can be done by setting the `retry` option to `0`
+when opening a connection:
+
+[source,erlang]
+----
+{ok, ConnPid} = gun:open("localhost", 12345, #{
+ retry ⇒ 0
+}).
+----