Skip to content

Commit

Permalink
Allow shutting down the active remote server
Browse files Browse the repository at this point in the history
  • Loading branch information
baldurk committed Sep 13, 2016
1 parent c1a0b48 commit c10c487
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
11 changes: 11 additions & 0 deletions renderdocui/Code/RenderManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,19 @@ public void DisconnectFromRemoteServer()
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
Expand Down
4 changes: 3 additions & 1 deletion renderdocui/Windows/Dialogs/RemoteManager.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 14 additions & 6 deletions renderdocui/Windows/Dialogs/RemoteManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ private void updateConnectButton()
{
connect.Text = "Shutdown";

if (host.Busy || host.Connected)
if (host.Busy && !host.Connected)
connect.Enabled = false;
}
else
Expand Down Expand Up @@ -476,11 +476,19 @@ private void connect_Click(object sender, EventArgs e)
// 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)
{
Expand Down

0 comments on commit c10c487

Please sign in to comment.