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

Function RENDERDOC_CreateTargetControl

renderdoc/core/target_control.cpp:964–1009  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

962};
963
964extern "C" RENDERDOC_API ITargetControl *RENDERDOC_CC RENDERDOC_CreateTargetControl(
965 const rdcstr &URL, uint32_t ident, const rdcstr &clientName, bool forceConnection)
966{
967 rdcstr host = "localhost";
968 if(!URL.empty())
969 host = URL;
970
971 rdcstr deviceID = host;
972 uint16_t port = ident & 0xffff;
973
974 IDeviceProtocolHandler *protocol = RenderDoc::Inst().GetDeviceProtocol(deviceID);
975
976 if(protocol)
977 {
978 deviceID = protocol->GetDeviceID(deviceID);
979 host = protocol->RemapHostname(deviceID);
980 if(host.empty())
981 return NULL;
982
983 port = protocol->RemapPort(deviceID, port);
984 }
985 else
986 {
987 int32_t idx = deviceID.indexOf(':');
988 if(idx > 0)
989 {
990 host = deviceID.substr(0, idx);
991 }
992 }
993
994 if(port == 0)
995 return NULL;
996
997 Network::Socket *sock = Network::CreateClientSocket(host, port, 750);
998
999 if(sock == NULL)
1000 return NULL;
1001
1002 TargetControl *remote = new TargetControl(sock, clientName, forceConnection != 0);
1003
1004 if(remote->Connected())
1005 return remote;
1006
1007 delete remote;
1008 return NULL;
1009}

Callers 4

ExecuteAndInjectMethod · 0.85
refreshHostMethod · 0.85
connectionThreadEntryMethod · 0.85
on_update_clickedMethod · 0.85

Calls 9

GetDeviceProtocolMethod · 0.80
GetDeviceIDMethod · 0.80
RemapHostnameMethod · 0.80
RemapPortMethod · 0.80
CreateClientSocketFunction · 0.50
emptyMethod · 0.45
indexOfMethod · 0.45
substrMethod · 0.45
ConnectedMethod · 0.45

Tested by

no test coverage detected