[erlang-questions] gen_udp:send blocks?

Valentin Micic v@REDACTED
Fri Sep 7 13:37:58 CEST 2018


On 07 Sep 2018, at 12:11 PM, Roger Lipscombe wrote:

> I've got a gen_server that, in response to handle_cast, calls
> gen_udp:send. On one server, the call to gen_udp:send takes about
> 1500us. On a different server, the call takes about 75000us.
> 
> Because of this, the process message queue is getting backed up, at
> the rate of about 120-250 messages/minute.
> 
> The difference between the servers is obvious: one of them is in the
> same AWS region as the destination host; the other is the other side
> of the Atlantic (i.e. about 70ms away).
> 
> My question is more about understanding the semantics of gen_udp:send:
> why is it blocking? If the buffer was full, I'd expect it to discard
> the message and return immediately.
> 
> Regards,
> Roger.
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

UDP should behave the way you expected. May I ask if the caller of gen_udp:send is the owner (e.g. creator) of the socket?

V/


More information about the erlang-questions mailing list