检测连接到我的网络的设备 [英] detecting devices connected to my network

查看:85
本文介绍了检测连接到我的网络的设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要Java代码来检测当前连接的设备到我的网络。
我尝试了以下想法:
- 对于所有可能的地址检查此地址是否已连接(254循环)
- 加快此过程我为每个检查创建了一个线程以使它们运行并行

I need Java code to detect current connected devices to my network. I tried the following idea : - for all possible addresses check if this address is connected ( 254 loop ) - to speed up this process I created a thread for each check to make them run in parallel

有没有更有效的方法?

推荐答案

那么有很多方法可以检测网络设备,你没有具体说明你的情况。

Well there are lots of ways of detecting networked devices and you give no specifics on the nature of your situation.

我能想到的最简单(也是最简单)的方法要ping你的IP网络的广播地址,然后查阅系统的ARP表。
不幸的是,我没有特别的策略来从Java访问ARP表来建议。

The simplest (and most simplistic) approach I can think of would be to ping the broadcast address of your IP network and then consult the system's ARP table. Unfortunately I have no particular strategy for accessing the ARP table from Java to suggest.

这篇关于检测连接到我的网络的设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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