Allow shutting down the active remote server

This commit is contained in:
baldurk
2016-09-13 11:52:28 +02:00
parent c1a0b4857b
commit c10c487a02
3 changed files with 28 additions and 7 deletions
+11
View File
@@ -370,8 +370,19 @@ namespace renderdocui.Code
m_Remote = null;
}
public void ShutdownServer()
{
if(m_Remote != null)
m_Remote.ShutdownServerAndConnection();
m_Remote = null;
}
public void PingRemote()
{
if (m_Remote == null)
return;
if (Monitor.TryEnter(m_Remote))
{
try
+3 -1
View File
@@ -310,8 +310,10 @@
this.ClientSize = new System.Drawing.Size(602, 460);
this.Controls.Add(tableLayoutPanel1);
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Name = "RemoteManager";
this.MinimizeBox = false;
this.MaximizeBox = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Remote Host Manager";
tableLayoutPanel1.ResumeLayout(false);
+14 -6
View File
@@ -371,7 +371,7 @@ namespace renderdocui.Windows.Dialogs
{
connect.Text = "Shutdown";
if (host.Busy || host.Connected)
if (host.Busy && !host.Connected)
connect.Enabled = false;
}
else
@@ -476,11 +476,19 @@ namespace renderdocui.Windows.Dialogs
// shut down
try
{
RemoteServer server = StaticExports.CreateRemoteServer(host.Hostname, 0);
server.ShutdownServerAndConnection();
hosts.BeginUpdate();
SetRemoteServerLive(node, false, false);
hosts.EndUpdate();
if (host.Connected)
{
m_Core.Renderer.ShutdownServer();
SetRemoteServerLive(node, false, false);
}
else
{
RemoteServer server = StaticExports.CreateRemoteServer(host.Hostname, 0);
server.ShutdownServerAndConnection();
hosts.BeginUpdate();
SetRemoteServerLive(node, false, false);
hosts.EndUpdate();
}
}
catch (Exception)
{