[erlang-questions] gen_tcp:recv/3 timeout

Ahmed Omar spawn.think@REDACTED
Tue Dec 27 14:27:58 CET 2011


Sorry hit the send button too early!
It's number 2
I think some solutions would be :
1) receive smaller N of bytes with a smaller timeout, and loop
(accumulate your timeout)
or
2) use {active, once} and receive messages on your own pace. (control when
to timeout)


On Tue, Dec 27, 2011 at 2:21 PM, Ahmed Omar <spawn.think@REDACTED> wrote:

> It's number
>
> On Tue, Dec 27, 2011 at 2:10 AM, Roberto Ostinelli <roberto@REDACTED>wrote:
>
>> dear list,
>>
>> when calling gen_tcp:recv/3 by specifying a length and a timeout, when
>> will {error, timeout} be a response? Is it:
>>
>> 1. when no bytes are received for a period longer than the specified
>> Timeout
>> 2. when the number of bytes specified in Length is not received within
>> Timeout
>>
>> if 2, what is the best solution to actually *not* have a recv/3 timeout
>> while receiving bytes at a very low pace (for instance on very slow
>> connections)?
>>
>> thank you,
>>
>> r.
>>
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
>
>
> --
> Best Regards,
> - Ahmed Omar
> http://nl.linkedin.com/in/adiaa
> Follow me on twitter
> @spawn_think <http://twitter.com/#!/spawn_think>
>
>


-- 
Best Regards,
- Ahmed Omar
http://nl.linkedin.com/in/adiaa
Follow me on twitter
@spawn_think <http://twitter.com/#!/spawn_think>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20111227/3bd33e9e/attachment.htm>


More information about the erlang-questions mailing list