tags:

views:

48

answers:

1

I made two console app: Broadcasting listener and UDP writer (for practice only). Each run on different machine over the internet.

Broadcasting listener:

INADDR_ANY, port 5555

Udp writer:

Enabled Broadcasting (setsockopt, SO_BROADCAST)

Case:

  1. The writer send some datagrams to listener server (ip: 113.169.123.138). Listener can receive those datagrams.

  2. The writer broadcasting to 255.255.255.255. Listener can not receive anythings.

Question:

  • What i need to do to make case 2 work?
+4  A: 

Your broadcasts are meant for your subnet and not the internet.

For example DHCP -- this application is meant to perform broadcasts to assign IP addresses to machines logically part of a particular subnet.

If you join the reader machines subnet via a VPN, then the reader machine will be able to receive your broadcast.

Hassan Syed