MCPcopy Create free account
hub / github.com/baldurk/renderdoc / ActiveRemoteClientThread

Function ActiveRemoteClientThread

renderdoc/core/remote_server.cpp:283–1064  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

281}
282
283static void ActiveRemoteClientThread(ClientThread *threadData,
284 RENDERDOC_PreviewWindowCallback previewWindow)
285{
286 Threading::SetCurrentThreadName("ActiveRemoteClientThread");
287
288 Network::Socket *&client = threadData->socket;
289
290 client->SetTimeout(RemoteServer_TimeoutMS());
291
292 uint32_t ip = client->GetRemoteIP();
293
294 rdcarray<rdcstr> tempFiles;
295 IRemoteDriver *remoteDriver = NULL;
296 IReplayDriver *replayDriver = NULL;
297 ReplayProxy *proxy = NULL;
298 RDCFile *rdc = NULL;
299 Callstack::StackResolver *resolver = NULL;
300
301 FileIO::LogFileHandle *debugLog = NULL;
302
303 WriteSerialiser writer(new StreamWriter(client, Ownership::Nothing), Ownership::Stream);
304 ReadSerialiser reader(new StreamReader(client, Ownership::Nothing), Ownership::Stream);
305
306 if(RemoteServer_DebugLogging())
307 {
308 reader.ConfigureStructuredExport(&GetRemoteServerChunkName, false, 0, 1.0);
309 writer.ConfigureStructuredExport(&GetRemoteServerChunkName, false, 0, 1.0);
310
311 rdcstr filename = FileIO::GetTempFolderFilename() + "/RenderDoc/RemoteServer_Server.log";
312
313 RDCLOG("Logging remote server work to '%s'", filename.c_str());
314
315 // truncate the log
316 debugLog = FileIO::logfile_open(filename);
317 FileIO::logfile_close(debugLog, filename);
318 debugLog = FileIO::logfile_open(filename);
319
320 reader.EnableDumping(debugLog);
321 writer.EnableDumping(debugLog);
322 }
323
324 writer.SetStreamingMode(true);
325 reader.SetStreamingMode(true);
326
327 uint32_t captureNum = 0;
328
329 while(client)
330 {
331 if(client && !client->Connected())
332 break;
333
334 if(threadData->killThread)
335 break;
336
337 // this will block until a packet comes in.
338 RemoteServerPacket type = reader.ReadChunk<RemoteServerPacket>();
339
340 if(reader.IsErrored() || writer.IsErrored())

Callers 1

BecomeRemoteServerMethod · 0.85

Calls 15

SetCurrentThreadNameFunction · 0.85
TickDeviceLogcatFunction · 0.85
FmtFunction · 0.85
GetCurrentPIDFunction · 0.85
ToStrFunction · 0.85
rdctieFunction · 0.85
rdcstrClass · 0.85
GetIPOctetFunction · 0.85
SetTimeoutMethod · 0.80
EnableDumpingMethod · 0.80
SetStreamingModeMethod · 0.80

Tested by

no test coverage detected