Re: Receive UDP broadcast packets with OTRcvUData
Re: Receive UDP broadcast packets with OTRcvUData
- Subject: Re: Receive UDP broadcast packets with OTRcvUData
- From: Cameron Kerr <email@hidden>
- Date: Thu, 4 Nov 2004 08:58:35 +1300
On 4/11/2004, at 2:50 AM, Matthieu Beghin wrote:
I create a Synchrone socket and set it non blockling. It receives
broadcast on 2.255.255.255.
Sometimes I have to answer by broadcast and I get the error
kEACCESErr
-3212
Permission denied
I suspect this is coming from the Sockets layer (I've no experience
with Mac programming, but plenty of Unix)
In order to prevent people from accidentally sending to a broadcast
socket, the socket option SO_BROADCAST must be turned on for a call to
the bind() system call to work with a broadcast socket. Otherwise, you
get Permission denied. This does not imply you need to be root, but
rather that you haven't jumped through a particular hoop.
I successfully set the IP_BROADCAST option to my socket (no error &
status == T_SUCCESS).
IP_BROADCAST would be different to SO_BROADCAST, as SO_BROADCAST is a
option at the Socket layer, not the IP layer. I don't know what
IP_BROADCAST for. I've not seen it in my training.
What is the code you are using to turn the option on?
I create a Synchrone socket and set it non blockling.
What is a Synchrone socket? (Please forgive my newliness ;^)
--
Cameron Kerr
email@hidden; http://humbledown.org
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden