Skip to content

Commit

Permalink
Improve docs for Mint.HTTP.recv/3
Browse files Browse the repository at this point in the history
Closes #413.
  • Loading branch information
whatyouhide committed Nov 8, 2023
1 parent 76db5ed commit fe80d7e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/mint/http.ex
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,14 @@ defmodule Mint.HTTP do
This function will raise an error if the socket is in active mode.
> #### Hanging Waiting for Bytes {: .warning}
>
> If `byte_count` is greater than `0` and the socket doesn't receive
> *at least* `byte_count` bytes withing the `timeout`, then the function
> will block for the duration of `timeout` and then return a timeout error.
> This behavior is the same as the `recv` function in [`:gen_tcp`](`:gen_tcp`)
> and [`:ssl`](`:ssl`).
## Examples
{:ok, conn, responses} = Mint.HTTP.recv(conn, 0, 5000)
Expand Down

0 comments on commit fe80d7e

Please sign in to comment.