Send a broadcast in UDP

Send a broadcast in UDP

Post by jér?me LANDREA » Tue, 03 Aug 1999 04:00:00



Hello

I have an application ( JDK 1.2 ) in the RH6.0, and I want to send a
broadcast with UDP :
I create a DatagramSocket in the port 2500, a new packet ( with the IP
255.255.255.255 ). When I  try to send this packet, an error occurs : I
don't have the permission.

Could you help me ?

 
 
 

Send a broadcast in UDP

Post by Sri Hary Vengadasubb » Wed, 04 Aug 1999 04:00:00


Hello,

Did you call setsockopt ( ... , SO_BROADCAST, ...) system call before
binding the socket ? That is the only thing that comes to my mind.

Btw, How are you receiving the Broadcast ? Are you using sockets to
receiving it ? I had been having some problem with AIX platform
with UDP and receiving Broadcast on IP 255.255.255.255. I am curious
to learn your experience.

Sri Hary V


> Hello

> I have an application ( JDK 1.2 ) in the RH6.0, and I want to send a
> broadcast with UDP :
> I create a DatagramSocket in the port 2500, a new packet ( with the IP
> 255.255.255.255 ). When I  try to send this packet, an error occurs : I
> don't have the permission.

> Could you help me ?


 
 
 

Send a broadcast in UDP

Post by jér?me LANDREA » Thu, 05 Aug 1999 04:00:00


Sri Hary Vengadasubbu wrote :

Quote:> Hello,

> Did you call setsockopt ( ... , SO_BROADCAST, ...) system call before
> binding the socket ? That is the only thing that comes to my mind.

> Btw, How are you receiving the Broadcast ? Are you using sockets to
> receiving it ? I had been having some problem with AIX platform
> with UDP and receiving Broadcast on IP 255.255.255.255. I am curious
> to learn your experience.

> Sri Hary V

Thank you for your help, but It's seems to be a bug in the JDK1.2 for linux
( bug ID : 1187 ).
See :  http://www.blackdown.org/cgi-bin/jdk

Jerome

 
 
 

1. problems sending UDP packet to broadcast addr

I'm hoping someone can help me figure out why I cant use
sendto() to send a UDP packet to a broadcast address under linux.

Lets say the normal IP is 192.168.1.1
I can use the same code on solaris, to bind to 192.168.1.1, and then
use sendto() to send a packet to 192.168.1.255

But on linux (either as regular user, or as root), I get an error,
 send failed: Permission denied

(the 'Permission denied' is from perror() )

Any suggestions?

If someone wants to play with real code, you can get it from

http://www.bolthole.com/freeha/freeha-0.9.tar.gz

--
[Trim the no-bots from my address to reply to me by email!]
[ Do NOT email-CC me on posts. Pick one or the other.]

http://www.spamlaws.com/state/ca1.html

2. BUG IN DYNAMIC LINKER (Xemacs 21.1.3)

3. Send a broadcast with UDP

4. Installed another processor, won't boot.

5. udp broadcast address 255.255.255.255 send error.

6. help with Xconfigurator Compaq CDS 520

7. How can I send an UDP-Broadcast?

8. printer

9. send udp packet to broadcast address

10. pppd dial ins and , "LCP: timeout sending Config-Requests"

11. udp broadcast forwarding

12. UDP port broadcasting

13. broadcasting using UDP