summaryrefslogtreecommitdiffstats
path: root/docs/en/gun/2.0/guide/websocket.asciidoc
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2020-11-16 16:12:55 +0100
committerLoïc Hoguin <[email protected]>2020-11-16 16:12:55 +0100
commit7d61b485e47e247d7ecac500c83a902ab934f569 (patch)
treee704c44ee5ede186ade88d36b742fb0854805e1c /docs/en/gun/2.0/guide/websocket.asciidoc
parent90e4885d7ca8e9d4a5e18f898fc172da900015c5 (diff)
downloadninenines.eu-7d61b485e47e247d7ecac500c83a902ab934f569.tar.gz
ninenines.eu-7d61b485e47e247d7ecac500c83a902ab934f569.tar.bz2
ninenines.eu-7d61b485e47e247d7ecac500c83a902ab934f569.zip
Update documentation
Diffstat (limited to 'docs/en/gun/2.0/guide/websocket.asciidoc')
-rw-r--r--docs/en/gun/2.0/guide/websocket.asciidoc8
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/en/gun/2.0/guide/websocket.asciidoc b/docs/en/gun/2.0/guide/websocket.asciidoc
index 287b3f73..ba06e2c7 100644
--- a/docs/en/gun/2.0/guide/websocket.asciidoc
+++ b/docs/en/gun/2.0/guide/websocket.asciidoc
@@ -49,7 +49,7 @@ undocumented and must be set to `gun_ws_h`.
.Upgrade to Websocket with protocol negotiation
[source,erlang]
----
-gun:ws_upgrade(ConnPid, "/websocket", []
+StreamRef = gun:ws_upgrade(ConnPid, "/websocket", []
#{protocols => [{<<"xmpp">>, gun_ws_h}]}).
----
@@ -88,18 +88,18 @@ Once the Websocket upgrade has completed successfully, you no
longer have access to functions for performing requests. You
can only send and receive Websocket messages.
-Use `gun:ws_send/2` to send messages to the server.
+Use `gun:ws_send/3` to send messages to the server.
.Send a text frame
[source,erlang]
----
-gun:ws_send(ConnPid, {text, "Hello!"}).
+gun:ws_send(ConnPid, StreamRef, {text, "Hello!"}).
----
.Send a text frame, a binary frame and then close the connection
[source,erlang]
----
-gun:ws_send(ConnPid, [
+gun:ws_send(ConnPid, StreamRef, [
{text, "Hello!"},
{binary, BinaryValue},
close