Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to populate a list/gridview with device IP & MAC information from "black boxes" that we install on client networks. Sometimes there can be over 100 of these boxes. So I want to populate the list by discovery versus manual entry even if they give us the static IPs.

After UDP discovery, all communication takes place via TCP. Everything works fine with the program, except the UDP discovery. I haven't messed with UDP before, so I may just be missing something simple.

Through trial, error, and reading a lot of posts/examples I've come to these conclusions or questions:

Is there no way to just blast the port without an IP? Using the udpclient, it seems I must first connect to a valid or alive remote host. When I put in a range of IPs to send to, if the initial node is not alive, I'll get nothing back from any of the remote IPs. Even when there are valid devices replying back in that range as I send. Only if I start with a node that is alive, I'll get back the response in udpclient.Receive.

Is there another way of doing this? Am I doing something wrong and need to post some code? I've looked at multicasting and broadcast groups, but think the client' IT Admin may be hesitant. Any help is much appreciated. Sorry for the long post. Just trying to explain where I want to go with it.


Jason
Posted

1 solution

So long as it is not blocked on the network you could use UDP broadcast, where by the "black boxes" listen for the broadcast and send back their IP/MAC information to the sender, it will not be instant so you may have to wait a few seconds.

This[^] article has some information on UDP broadcast.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900