开发者

receiving datagrams sent by client over internet

开发者 https://www.devze.com 2022-12-20 17:46 出处:网络
I made two console app: Broadcasting listener and UDP writer (for practice only). Each run on different machine over the 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:

  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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消