I am developing C# code that pings all hosts within a subnet (from 1-255) with ARP requests (funny how many devices responds to ARP requests, but not pinging).
With Ping I can set the timeout and run Async, and it takes a second to scan a subnet. I am not sure how I will do this with ARP, since I can't set the timeout value. Can I send requests in threads? I have little experience with multithreading, but any help is welcome.
[DllImport("iphlpapi.dll", ExactSpelling = true)]
public static extern int SendARP(int DestIP, int SrcIP, byte[] pMacAddr, ref uint, PhyAddrLen);
...
if (SendARP(intAddress, 0, macAddr, ref macAddrLen) == 0)
{
// Host found! Woohoo
}