receiving datagrams sent by client over internet
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:
The writer send some datagrams to listener server (ip: 113.169.123.138). Listener can receive those datagrams.
The writer broadcasting to 255.255.255.255. Listener can not receive anythings.
Q开发者_高级运维uestion:
- What i need to do to make case 2 work?
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.
精彩评论