mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 09:00:44 +00:00
Allow multiple remote servers on one hostname, on different ports
* When a port is specified (with the usual :12345 suffix on the hostname) we use that for remote replay connections. We disable target control enumeration since that requires a port _range_ and captured applications self-assign those ports. Those can still be accessed via a normal unsuffixed remote specifier - even if there is no remote server running on the default port.
This commit is contained in:
@@ -456,6 +456,7 @@ private:
|
||||
std::string host;
|
||||
bool daemon = false;
|
||||
bool preview = false;
|
||||
uint16_t port = 0;
|
||||
|
||||
public:
|
||||
RemoteServerCommand() : Command() {}
|
||||
@@ -465,6 +466,9 @@ public:
|
||||
parser.add<std::string>(
|
||||
"host", 'h', "The interface to listen on. By default listens on all interfaces", false, "");
|
||||
parser.add("preview", 'v', "Display a preview window when a replay is active.");
|
||||
parser.add<uint32_t>(
|
||||
"port", 'p',
|
||||
"The port to listen on. Default is 0, which listens on RenderDoc's default port.", false, 0);
|
||||
}
|
||||
virtual const char *Description()
|
||||
{
|
||||
@@ -478,12 +482,15 @@ public:
|
||||
host = parser.get<std::string>("host");
|
||||
daemon = parser.exist("daemon");
|
||||
preview = parser.exist("preview");
|
||||
port = parser.get<uint32_t>("port") & 0xffff;
|
||||
return true;
|
||||
}
|
||||
virtual int Execute(const CaptureOptions &)
|
||||
{
|
||||
std::cerr << "Spawning a replay host listening on " << (host.empty() ? "*" : host) << "..."
|
||||
<< std::endl;
|
||||
std::cerr << "Spawning a replay host listening on " << (host.empty() ? "*" : host);
|
||||
if(port != 0)
|
||||
std::cerr << ":" << port;
|
||||
std::cerr << "..." << std::endl;
|
||||
|
||||
if(daemon)
|
||||
{
|
||||
@@ -504,7 +511,7 @@ public:
|
||||
if(DisplayRemoteServerPreview(false, {}).system != WindowingSystem::Unknown)
|
||||
previewWindow = &DisplayRemoteServerPreview;
|
||||
|
||||
RENDERDOC_BecomeRemoteServer(conv(host), []() { return killSignal; }, previewWindow);
|
||||
RENDERDOC_BecomeRemoteServer(conv(host), port, []() { return killSignal; }, previewWindow);
|
||||
|
||||
std::cerr << std::endl << "Cleaning up from replay hosting." << std::endl;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user