简体   繁体   中英

detecting devices connected to my network

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

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. Unfortunately I have no particular strategy for accessing the ARP table from Java to suggest.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM