Discovering clients on a wifi network

前端 未结 4 1321
不知归路
不知归路 2021-01-23 16:34

I\'m writting a java application, and I need to quickly discover any other running clients on any wired or wireless local networks in order to establish a TCP connection.

<
4条回答
  •  别那么骄傲
    2021-01-23 17:00

    I guess you need to do a scan on your application's port on all IPs in your subnet.

    Just what are the available IPs - or what is your subnet for that matter?
    I'm afraid determining that could turn out to be impossible as the network is designed to be transparent to your application.

    So, i'd use brute force: pick your IP and change the last byte. Might be too much, might be not enough though.

    Or you send a broadcast (which usually would be targeted at x.x.x.255) and see who answers. See Datagram Broadcasting and Multicasts. But i think that's not TCP/IP anymore.

提交回复
热议问题