Check remote server status at startup to pre-populate context chooser

This commit is contained in:
baldurk
2016-08-19 17:26:20 +02:00
parent dca8fe7905
commit 0207c74b90
3 changed files with 52 additions and 46 deletions
+25 -2
View File
@@ -29,6 +29,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Threading;
using System.Xml;
using System.Xml.Serialization;
using renderdoc;
@@ -44,13 +45,35 @@ namespace renderdocui.Code
[XmlIgnore]
public bool ServerRunning = false;
[XmlIgnore]
public bool Connected = false;
[XmlIgnore]
public bool Busy = false;
public void CheckStatus()
{
try
{
RemoteServer server = StaticExports.CreateRemoteServer(Hostname, 0);
ServerRunning = true;
Busy = false;
server.ShutdownConnection();
}
catch (ReplayCreateException ex)
{
if (ex.Status == ReplayCreateStatus.NetworkRemoteBusy)
{
ServerRunning = true;
Busy = true;
}
else
{
ServerRunning = false;
Busy = false;
}
}
}
public void Launch()
{
try