Mint.HTTP.set_mode
You're seeing just the function
set_mode
, go back to Mint.HTTP module for more information.
Specs
set_mode(t(), :active | :passive) :: {:ok, t()} | {:error, Mint.Types.error()}
Changes the mode of the underlying socket.
To use the connection in active mode, where the process that started the
connection receives socket messages, set the mode to :active
(see also stream/2
).
To use the connection in passive mode, where you need to manually receive data
from the socket, set the mode to :passive
(see also recv/3
).
The mode can also be controlled at connection time by the :mode
option passed
to connect/4
.
Note that if you're switching from active to passive mode, you still might have socket messages in the process mailbox that you need to consume before doing any other operation on the connection.
See the "Mode" section in the module documentation for more information on modes.
Examples
{:ok, conn} = Mint.HTTP.set_mode(conn, :passive)