broadcast (solved)

Joe Armstrong <>
Wed Jul 3 16:21:34 CEST 2002


On Wed, 3 Jul 2002, Joe Armstrong wrote:

> 
> I have several machines on a LAN
> 
> How do I set up a low-level broadcast system.
> 
> I can find the broadcast address with
>  
>     {ok, [{broadaddr, Ip}]} = inet:ifget("eth0", [broadaddr]),
> 
> But then what?
> 
>     How do I send to the broadcast address and what port do I use?
> 
> This didn't work:
> 
> 	{ok, S} = gen_udp:open(5010),
>         gen_udp:send(S, Ip, 6000, Str)
> 
 ... cut ...

> Any ideas what is going wrong here????
> 

   It should have been

	 {ok, S} = gen_udp:open(5010, [{broadcast, true}]),

   You nitwit

   RTFM	

   /Joe

> Thanks
> 
> /Joe
> 
>  
> 
> 




More information about the erlang-questions mailing list