[erlang-questions] gen_tcp:send {error, timeout} and ways to restore situation?

Tony Rogvall tony@REDACTED
Mon Sep 12 23:34:32 CEST 2016


Is that not the same as setting 1000 milliseconds timeout? ;-)

Without setting the send_timeout you could also try to poll using inet:getstat(Socket, send_pend)
to see if something is being sent (to the kernel.)

If OTP release the subscription interface in prim_inet
(or you do a hack) you could get information about empty output queue as an event.

Maybe a better event in this case would to be able to get low watermark trigger so you can
keep the send buffer full?
A suggestion would to be able to subscribe to {subs_out_q_size_lte, Size}
where the old name subs_empty_out_q could be equivalent to {subs_out_q_size_lte, 0 }.

/Tony

> On 12 sep 2016, at 21:37, Max Lapshin <max.lapshin@REDACTED> wrote:
> 
> I ask erlang to send 1000 bytes to network during 500 milliseconds.
> 
> Erlang returns error, timeout. It may be because OS have consumed 500 bytes and 500 left inside driver.  I want to ask driver to try again to transmit these 500 bytes.
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160912/e7221150/attachment.bin>


More information about the erlang-questions mailing list