[erlang-questions] Return status of gen_udp send

Dmitry Kolesnikov <>
Sat Jun 2 11:14:35 CEST 2012


Hi,

There are no cross platform & erlangish way to detect it. 
On linux platform kernel maintains various counters including drop ratio  at /proc/<pid>/net/udp

I do not see a reason why your application should look into that metric. Since, udp is not reliable by nature only e2e flow control make sense. If you are just worried about a local instance then I would propose to use bandwidth as a flow control metric. In this respect a inet:getstat(Socket) is enough http://erldocs.com/R14B02/kernel/inet.html?i=10&search=inet:get#getstat/2


- Dmitry

On Jun 2, 2012, at 11:47 AM, Arun Muralidharan wrote:

> Yes Torben, you are correct about the question. But how would I check if my application is pushing the machine too hard. As UDP is "send and forget" as said by Tim, so does the performance of UDP send really comes down to the performance of kernel/machine not the application ?
> 
> Thanks
> -A
> 
> 
> On Sat, Jun 2, 2012 at 1:09 PM, Torben Hoffmann <> wrote:
> Tim, you are correct about the 'fire and forget', but that is only for the part outside your own machine.
> 
> The original poster wanted to know if the message really got sent or got dropped in his own machine.
> Which actually poses a question in my head: what does it matter where the message was lost?
> The only reason I can think of right now is to control load on your own kernel and slow down if you are pushing your machine too hard.
> Perhaps the original poster can clarify?
> 
> Cheers,
> Torben
> 
> 
> On 02/06/2012 07:29, Tim McNamara wrote:
> Others can correct me.
> 
> AFAIK UDP is 'fire and forget'. You don't get the opportunity to check
> whether the message was received, or even if there was someone there
> to receive it.
> 
> 
> On 2 June 2012 17:18, Arun Muralidharan<>  wrote:
> A Remider. :) (As per Joe's suggestion on unanswered questions)
> -Arun
> 
> 
> On Thu, May 31, 2012 at 10:34 PM, Arun Muralidharan<>
> wrote:
> Hi Folks!
> Is there any way to detect if the packet sent by issuing the statement
> "gen_udp:send" is really sent or got dropped because of buffer overflow in
> the kernel .
> I am using UDP socket with one of the option set as active once and both
> send and receive buffer set to 2MB.
> 
> 
> Thanks,
> -A
> 
> 
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
> 
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
> 
> -- 
> http://www.linkedin.com/in/torbenhoffmann
> 
> 
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120602/6d85bd60/attachment.html>


More information about the erlang-questions mailing list