get IP addresses of computer available on a network? -java

后端 未结 7 2202
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-12 02:36

I am making a file sharing application which would look for computers which are running the application on the same network. So I would like my application to discover compu

7条回答
  •  醉梦人生
    2020-12-12 03:27

    One problem here is that 'the same network' isn't well defined. Do you mean a subnet? All the nodes reachable prior to a router?

    If for example you mean 'the LAN', this has no meaning in TCP, but SAMBA might be of help.

    Some of that can be addressed by using appropriately scope multicast, if you can get the other nodes to respond. Or if you know the subnet mask you can just do IP address arithmetic. But you need to define your problem more precisely first.

提交回复
热议问题