[erlang-questions] gen_udp in passive mode

Valentin Micic v@REDACTED
Tue Apr 14 07:54:04 CEST 2009


I don't think that length make any sense in gen_udp:recv/2 in fact, I do not
think that gen_udp:recv makes any sense at all. If anything, one should have
called such a function gen_udp:recvfrom, which is, if memory serves me
correctly, the name of the system call to retrieve a message from UDP
socket. Considering that UDP respects message boundaries, it would be more
in a spirit of Erlang to implement such a function with one argument only,
e.g. gen_udp:recvfrom( UDP_socket ).

V.

-----Original Message-----
From: erlang-questions-bounces@REDACTED
[mailto:erlang-questions-bounces@REDACTED] On Behalf Of Francesco Cesarini
(Erlang Training and Consulting)
Sent: 14 April 2009 07:16 AM
To: erlang-questions@REDACTED
Subject: [erlang-questions] gen_udp in passive mode

Running a UDP socket in passive mode, you retrieve the packets using 
gen_udp:recv(Socket, Length). I could not find any reference to what 
Length  is used for in the documentation (Other than being used in 
gen_tcp module when packet types are raw). Is there a reason to have it 
here other than symmetry in the call among the modules?

I recall  a thread on the mailing list some time ago, but might be wrong 
as I could not find any reference to it.

Thanks,
Francesco
--
http://www.erlang-consulting.com
_______________________________________________
erlang-questions mailing list
erlang-questions@REDACTED
http://www.erlang.org/mailman/listinfo/erlang-questions




More information about the erlang-questions mailing list