I see many people using ping to see if a server is up or not. In my test ping is ok but RPC is not allowed so it fails showing "The RPC server is unavailable".
How can I also test RPC before executing my entire code? (executed if ping is ok - see below)
var ping = new Ping();
try{
var reply = ping.Send(server, 1000);
if(reply.Status == IPStatus.Success /*Maybe add here AND RPC is ok*/){
//do thousands of stuff - I ONLY want to enter here IF RPC IS OK
/* Should have something here to test
RPC if(RPC==ok){ execute my huge code }
*/
}
}catch(Exception ex){
//message the error
}