This commit is contained in:
Virtuworks 2014-12-24 13:03:56 -05:00
commit e87a42e3cb
11 changed files with 132 additions and 32 deletions

View file

@ -605,13 +605,20 @@ namespace WebsitePanel.EnterpriseServer
}
else
{
result.AddError("", new Exception("The server that you are adding, is not available"));
result.AddError("REMOTE_DESKTOP_SERVICES_ADD_RDS_SERVER", new Exception("The server that you are adding, is not available"));
return result;
}
}
catch (Exception ex)
{
result.AddError("REMOTE_DESKTOP_SERVICES_ADD_RDS_SERVER", ex);
if (ex.InnerException != null)
{
result.AddError("Unable to add RDS Server", ex.InnerException);
}
else
{
result.AddError("Unable to add RDS Server", ex);
}
}
finally
{
@ -1167,18 +1174,12 @@ namespace WebsitePanel.EnterpriseServer
private static bool CheckRDSServerAvaliable(string hostname)
{
bool result = false;
var ping = new Ping();
var reply = ping.Send(hostname, 1000);
try
if (reply.Status == IPStatus.Success)
{
var ping = new Ping();
var reply = ping.Send(hostname, 1000); // 1 second time out (in ms)
if (reply.Status == IPStatus.Success)
result = true;
}
catch (Exception)
{
result = false;
result = true;
}
return result;