[erlang-questions] sending packets using gen_udp

Chandru <>
Wed Aug 1 01:11:37 CEST 2007


On 30/07/07, igwan <> wrote:
> Hi,
>
> I have a process that sends a number of UDP packets at a time using
> gen_udp:send/2 .
> I open the socket with :
>
> {ok, Socket}  = gen_udp:open(Local_port, [binary, {sndbuf, 16#100000}])
>
> then I send my 100 binary packets in a loop (1472 * 100 = 147200 bytes
> so this shouldn't fill my send buffer). gen_udp:send/2 returns 'ok' each
> time, but only 9 packets reach my network interface. Only when I send
> 200 or more packets at a time I get {error, eagain} but still only 9
> packets reach the interface.
>
> Why do packets get lost before being sent and without an error ?

Where are you sending the packets? When you say you see only 9 packets
on your network interface, which n/w interface are you talking about?
The source or the destination? If it is the destination, probably your
receiving end has a small receive buffer?



More information about the erlang-questions mailing list