简体   繁体   English

检测连接到我的网络的设备

[英]detecting devices connected to my network

I need Java code to detect current connected devices to my network. 我需要Java代码来检测当前连接到网络的设备。 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 我尝试了以下想法:-对于所有可能的地址,检查该地址是否已连接(254循环)-为了加快此过程,我为每次检查创建了一个线程,以使其并行运行

Is there any way more efficient ?? 有什么办法更有效吗?

Well there are lots of ways of detecting networked devices and you give no specifics on the nature of your situation. 嗯,有很多检测网络设备的方法,您没有提供具体情况的详细信息。

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. 我能想到的最简单(也是最简单)的方法是对IP网络的广播地址执行ping操作,然后查阅系统的ARP表。 Unfortunately I have no particular strategy for accessing the ARP table from Java to suggest. 不幸的是,我没有从Java访问ARP表的具体建议。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 通过执行Java中的ping命令来检测网络上的设备 - Detecting devices on network by executing the ping command in Java 加快查找连接到Wifi网络的设备并获取设备名称的速度 - Speed up finding devices connected to a Wifi network and get device name 以编程方式将设备连接到android中的同一wifi网络? - Get Devices connected to same wifi network in android programmatically? 找到连接到同一Wifi网络的所有设备的MAC地址 - Find the MAC address of all devices connected to the same Wifi network 如何在android中获取连接到同一网络的设备的mac地址? - How to get mac addresses of devices connected to the same network in android? 向连接到 Wi-Fi 网络的所有设备发送通知 - Send notification to all the devices connected to a Wi-Fi network 如何使用NSD获取连接到同一网络的所有设备的列表 - How to get list of all devices connected to same network using NSD 如何从 Android 应用程序检测 WiFi 网络中连接的所有设备 - How to detect all the Devices connected in a WiFi network from Android App 如何以编程方式通过Wifi获取连接到交换机网络的其他设备的IP地址? - How to get Ip address of other devices connected to switch network via Wifi programmatically? 是否可以获取我的家庭网络中所有已连接设备的mac地址? - Is it possible to get the mac addresses of all connected device in my home network?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM