2

I am trying to test my program that makes use of broadcast UDP (not multicast!). In Linux, I can use the 127.255.255.255:64651 address and everything works beautifully, in other words, I send a packet to 127.255.255.255:64651 and multiple clients listening on that port get the packet. A real broadcast example!

Unfortunately on my OS/X machine (Mountain Lion) the same example does not work.

Is there any way I can get 127.255.255.255 to work on mac machines? Any other solution to get broadcast working on my mac machine without a network?

Note: It has to be broadcast, not multicast.

0

2 Answers 2

1

127.255.255.255 should not work. Strange!

Use your network broadcast address, that's what it's for.

For instance, if your network is 192.168.10.0/24, your broadcast address is 192.168.10.255.

2
  • Thanks for the help, Mikey, but as I said I do not have a network to get this address from. The machine is offline. :) Commented Nov 10, 2013 at 3:49
  • 1
    Add a fake interface or add an IP to your loopback interface.
    – MikeyB
    Commented Nov 10, 2013 at 3:56
1

Instead of 127.255.255.255, on Mac OS X try using 224.255.255.255 as an alternative.

2
  • 1
    224.255.255.255 does not work. I found the right one, but since this is off-topic according to the moderators, I won't bother saying it. Nobody cares anyways! Commented Nov 11, 2013 at 3:11
  • 1
    JohnPristine, it is sad that you haven't posted the answer. Now I have to do my own quest :( Commented Aug 22, 2018 at 14:49

Not the answer you're looking for? Browse other questions tagged .