From 5793cfb2ca439eada5a3a0be168d83ed7b2d2a13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 23 Sep 2019 11:55:36 +0200 Subject: Document sending N Websocket frames in the guide --- doc/src/guide/websocket.asciidoc | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/doc/src/guide/websocket.asciidoc b/doc/src/guide/websocket.asciidoc index 8503670..662b9ea 100644 --- a/doc/src/guide/websocket.asciidoc +++ b/doc/src/guide/websocket.asciidoc @@ -96,20 +96,19 @@ Use `gun:ws_send/2` to send messages to the server. gun:ws_send(ConnPid, {text, "Hello!"}). ---- -// @todo Implement sending of N frames -// -//.Send a text frame, a binary frame and then close the connection -//[source,erlang] -//---- -//gun:ws_send(ConnPid, [ -// {text, "Hello!"}, -// {binary, BinaryValue}, -// close -//]). -//---- +.Send a text frame, a binary frame and then close the connection +[source,erlang] +---- +gun:ws_send(ConnPid, [ + {text, "Hello!"}, + {binary, BinaryValue}, + close +]). +---- Note that if you send a close frame, Gun will close the connection -cleanly but will attempt to reconnect afterwards. +cleanly but may attempt to reconnect afterwards depending on the +`retry` configuration. === Receiving data -- cgit v1.2.3