Mint.WebSocket.recv
You're seeing just the function
recv
, go back to Mint.WebSocket module for more information.
Specs
recv(Mint.HTTP.t(), non_neg_integer(), timeout()) :: {:ok, Mint.HTTP.t(), [Mint.Types.response()]} | {:error, t(), Mint.Types.error(), [Mint.Types.response()]}
Receives data from the socket
This function is used instead of stream/2
when the connection is
in :passive
mode. You must pass the mode: :passive
option to
new/5
in order to use recv/3
.
This function wraps Mint.HTTP.recv/3
. See the Mint.HTTP.recv/3
documentation for more information.
Examples
{:ok, conn, [{:data, ^ref, data}]} = Mint.WebSocket.recv(conn, 0, 5_000)
{:ok, websocket, [{:text, "hello world!"}]} =
Mint.WebSocket.decode(websocket, data)