Hi All,

I'm trying to send a UDP broadcast packet using Netty Camel component.

I'm sending the UDP packet to producer endpoint "netty:udp://
192.168.3.255:7777?broadcast=true&sync=false" (my network has mask
255.255.255.0) but I get the following exception:

java.io.IOException: Permission denied
   at sun.nio.ch.DatagramDispatcher.write0(Native Method)
   at sun.nio.ch.DatagramDispatcher.write(DatagramDispatcher.java:51)
   at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
   at sun.nio.ch.IOUtil.write(IOUtil.java:51)
   at sun.nio.ch.DatagramChannelImpl.write(DatagramChannelImpl.java:616)
   at sun.nio.ch.DatagramChannelImpl.send(DatagramChannelImpl.java:462)
   at
org.jboss.netty.channel.socket.nio.SocketSendBufferPool$UnpooledSendBuffer.transferTo(SocketSendBufferPool.java:207)
   at
org.jboss.netty.channel.socket.nio.NioDatagramWorker.write0(NioDatagramWorker.java:298)
   ...

The exception is the same addressed in this stackoverflow question:
http://stackoverflow.com/questions/5134288/securityexception-sending-broadcast-from-java-on-os-x,
I have tested it on my computer and it solve the problem, as you can see
I'm using the "broadcast=true" option on the URI, I was expecting it to
make the Camel URI work, but it doesn't.

I've tried to debug the NettyEndpoint to check if
channel.socket().setBroadcast(true); was called somewhere, but it is not
easy as source code of sun.nio.ch.DatagramChannelImpl is not available...

So, is it a bad usage from myself (am I missing to use some URI option?) or
is it a bug from the camel endpoint?

Thank you !
Cristiano

Reply via email to