在 wifi 网络上发现客户端 [英] Discovering clients on a wifi network

查看:66
本文介绍了在 wifi 网络上发现客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个 Java 应用程序,我需要在任何有线或无线本地网络上快速发现任何其他正在运行的客户端,以便建立 TCP 连接.

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.

这样做的最佳方法是什么?是否有可以执行此操作的库或代码片段?

what's the best way of doing this? Are there libraries or code snippets that would do this?

推荐答案

我猜您需要对子网中所有 IP 上的应用程序端口进行扫描.

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

可用的 IP 是什么 - 或者您的子网是什么?
由于网络被设计为对您的应用程序透明,因此我担心确定这可能是不可能的.

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.

因此,我会使用蛮力:选择您的 IP 并更改最后一个字节.可能太多,但可能还不够.

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

或者您发送广播(通常针对 x.x.x.255)并查看谁回答.请参阅数据报广播多播.但我认为那不再是 TCP/IP.

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.

这篇关于在 wifi 网络上发现客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆