discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sending UDP packets


From: Derek Fawcus
Subject: Re: Sending UDP packets
Date: Thu, 26 Nov 2009 01:46:18 -0800
User-agent: Mutt/1.4.2.3i

On Wed, Nov 25, 2009 at 09:39:21PM +0100, Andreas H?schler wrote:
> This works great on my Mac (10.2) when SRV_IP is "127.0.0.1". However, 
> in the end the sender process will run on machine A and the receiver 
> process on machine B, C, D, ... in our 192.168.1.0 LAN. I therefore 
> tried to use SRV_IP = "192.168.1.255" instead. When I do that I get
> 
> UDPSender[9746] sendto() failed
> 
> Why does this not work or what is the correct address to use for 
> interhost UDP traffic in a LAN?  What am I doing wrong?

Assuming that you have your 192.168.1.0 LAN configured as a 192.168.1.0/24,
then 192.168.1.255 is a network broadcast.  As such you may wish to
read up on and make use of the SO_BROADCAST socket option.

The equivalent broadcast address for the 127 net is 127.255.255.255,
you may find that your existing code gives an error in trying to use
that in the absense of SO_BROADCAST.

On some systems,  SO_BROADCAST is only available to root.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]