mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Ping the connected host regularly and check other hosts at lower freq.
* This lets us detect when a remote server has been disconnected and needs to be restarted, as well as alerting the user if this happens in the middle of a replay session. * Pinging other hosts means the context switcher is reasonably up to date if one of them comes up.
This commit is contained in:
@@ -70,6 +70,8 @@ namespace renderdocui.Code
|
||||
private List<InvokeHandle> m_renderQueue;
|
||||
private InvokeHandle m_current = null;
|
||||
|
||||
private bool m_CopyInProgress = false;
|
||||
|
||||
////////////////////////////////////////////
|
||||
// Interface
|
||||
|
||||
@@ -217,8 +219,13 @@ namespace renderdocui.Code
|
||||
{
|
||||
Helpers.NewThread(new ThreadStart(() =>
|
||||
{
|
||||
// prevent pings while copying off-thread
|
||||
m_CopyInProgress = true;
|
||||
|
||||
remotepath = m_Remote.CopyCaptureToRemote(localpath, ref progress);
|
||||
|
||||
m_CopyInProgress = false;
|
||||
|
||||
copied = true;
|
||||
})).Start();
|
||||
}
|
||||
@@ -271,8 +278,13 @@ namespace renderdocui.Code
|
||||
{
|
||||
Helpers.NewThread(new ThreadStart(() =>
|
||||
{
|
||||
// prevent pings while copying off-thread
|
||||
m_CopyInProgress = true;
|
||||
|
||||
m_Remote.CopyCaptureFromRemote(remotepath, localpath, ref progress);
|
||||
|
||||
m_CopyInProgress = false;
|
||||
|
||||
copied = true;
|
||||
})).Start();
|
||||
}
|
||||
@@ -328,6 +340,19 @@ namespace renderdocui.Code
|
||||
m_Remote = null;
|
||||
}
|
||||
|
||||
public void PingRemote()
|
||||
{
|
||||
if(m_CopyInProgress)
|
||||
return;
|
||||
|
||||
// must only happen on render thread if running
|
||||
if ((!Running || m_Thread == Thread.CurrentThread) && m_Remote != null)
|
||||
{
|
||||
if (!m_Remote.Ping())
|
||||
m_RemoteHost.ServerRunning = false;
|
||||
}
|
||||
}
|
||||
|
||||
public ReplayCreateException InitException = null;
|
||||
|
||||
public void CloseThreadSync()
|
||||
|
||||
Reference in New Issue
Block a user