How to use gr_make_udp_sink with the broadcast address?

Hi Readers,

I’d like to use gr_make_udp_sink with the broadcast address but error
“socket connect: Permission denied”. I’ve run in root.

The commands I used: (the address of PC: 192.168.1.66)

udp = gr_make_udp_sink(sizeof(gr_complex), “192.168.1.255”, udp_port,
1472, true);

and:

udp = gr_make_udp_sink(sizeof(gr_complex), “255.255.255.255”, udp_port,
1472, true);

Could you help me, please?

LuongTanPhong

On 09/18/2011 01:17 PM, Lương Tấn Phong wrote:

and:

udp = gr_make_udp_sink(sizeof(gr_complex), “255.255.255.255”,
udp_port, 1472, true);

Could you help me, please?

LuongTanPhong

Because on LInux, you have to explicitly ask for a socket to be
enabled for the broadcast address, using the
SO_BROADCAST socket option, which, I’m willing to bet, the underlying
methods for make_udp_sink don’t do.