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.

JohnPristine
  • 161
  • 1
  • 5

2 Answers2

1

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

Giacomo1968
  • 3,522
  • 25
  • 38
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.

MikeyB
  • 38,725
  • 10
  • 102
  • 186