udp broadcast address 255.255.255.255 send error.

udp broadcast address 255.255.255.255 send error.

Post by y721 » Sat, 24 Mar 2001 18:13:06



Hi,

If I use net broadcast address, it works fine.
In my case,
....
h.s_addr=inet_addr("192.9.255.255");
...
It works ok...

if I use s_addr= INADDR_BROADCAST or 255.255.255.255
I got send message error -1

I set socket option to broadcast.
Did I miss some thing important???

thank you.

 
 
 

udp broadcast address 255.255.255.255 send error.

Post by Barry Margoli » Sun, 25 Mar 2001 01:23:41



>Hi,

>If I use net broadcast address, it works fine.
>In my case,
>....
>h.s_addr=inet_addr("192.9.255.255");
>...
>It works ok...

>if I use s_addr= INADDR_BROADCAST or 255.255.255.255
>I got send message error -1

>I set socket option to broadcast.
>Did I miss some thing important???

I think most versions of Unix only recognize the directed broadcast
address, not the general broadcast address.  This may be because a
multi-homed machine will only broadcast on a single interface at a time, so
it needs a more specific address so it can determine which interface to
use.

--

Genuity, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

udp broadcast address 255.255.255.255 send error.

Post by y721 » Tue, 27 Mar 2001 12:12:47


Thank you, Barry,

My machine has only one Network card in it.

winSock recognize 255.255.255.255.

steve




> >Hi,

> >If I use net broadcast address, it works fine.
> >In my case,
> >....
> >h.s_addr=inet_addr("192.9.255.255");
> >...
> >It works ok...

> >if I use s_addr= INADDR_BROADCAST or 255.255.255.255
> >I got send message error -1

> >I set socket option to broadcast.
> >Did I miss some thing important???

> I think most versions of Unix only recognize the directed broadcast
> address, not the general broadcast address.  This may be because a
> multi-homed machine will only broadcast on a single interface at a time,
so
> it needs a more specific address so it can determine which interface to
> use.

> --

> Genuity, Burlington, MA
> *** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to
newsgroups.
> Please DON'T copy followups to me -- I'll assume it wasn't posted to the

group.
 
 
 

udp broadcast address 255.255.255.255 send error.

Post by Barry Margoli » Wed, 28 Mar 2001 03:57:30



>Thank you, Barry,

>My machine has only one Network card in it.

But the network API is designed to be the same for machines with one or
many NICs.  So it requires you to specify a subnet-specific broadcast
address.

--

Genuity, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.