[erlang-questions] gen_tcp:recv/3 timeout

Roberto Ostinelli roberto@REDACTED
Tue Dec 27 17:39:25 CET 2011

thank you very much klaar, and everyone for this clarification.


On Tue, Dec 27, 2011 at 7:52 AM, Magnus Klaar <magnus.klaar@REDACTED>wrote:

> Hi!
> gen_tcp:recv(..., N, M) returns {error, timeout} if N bytes has not been
> received after M milliseconds. If less bytes are available the call will
> _not_ succeed. If you are receiving data at a slow rate specifying 0 as the
> length is preferrable because the call will return whatever data is
> available at the time. If there is no data available it will wait and
> timeout if no data has been received after M milliseconds. If you don't
> want to timeout at all when doing this, specify infinity as the timout
> value.
> MVH Magnus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20111227/f8b625e9/attachment.htm>

More information about the erlang-questions mailing list