views:

22

answers:

0

Whats the best way of finding the closest server in the network from the list of servers. I have 2 servers in different locations and through code I want to connect to the one which is closest to where the application is deployed (in terms of connection time).

Also whats the best way to find out if a server is down keeping in mind that we have firewarlls that won't allow pinging the server. DirectoryEntry is taking a long time to get back trying to connect to this dead server and failing. Was thinking about applying the timeout but that doesn't look feasible as depending on the link speed the connection time may be different every time.

Its a ASP.net application using LDAP to connect and query the AD. If someone could guide me in the right direction as to what is the best practice for handling these scenarios?