In order to create a lan messenger in c# I need to detect the host computers online obviously using the same lan messenger software. I tried searching for a starting point to do so, but in vain. I need to know how to start the work.
There are two ways I've done this in the past: having all the clients connect to predefined host (easy, but requires some client configuration) and having the host (or client) broadcast their existence via the the 'broadcast' address (eg, 10.0.255.255) (hard, firewalls/NATs can make life painful, clients require no configuration).
But, yes -- if WCF implements a discovery protocol, go with that. Provided it does what you want, it's probably better than anything you (or most people, for that matter) could write.
Can you use Windows Connection Foundation? If so, you could use WCF to implement the WS-Discovery protocol. Here's a brief howto.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With