Establish Android port forwarding for COTF network fileserver and Unreal Insights

Change COTF server order to specify localhost first, speeding up connections for platforms that use port forwarding
#jira UEVR-2129
#jira UE-112392
#rb Steve.Smith
#preflight 606db84d963d84000187880a
#lockdown cristina.riveron

#ROBOMERGE-SOURCE: CL 15940305 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v787-15839533)

[CL 15944803 by jack porter in ue5-main branch]
This commit is contained in:
jack porter
2021-04-07 15:11:58 -04:00
parent 85e4897d4d
commit 70b51652ed
3 changed files with 85 additions and 119 deletions

View File

@@ -488,6 +488,20 @@ private:
TcpMessagingModule->AddOutgoingConnection(FString::Printf(TEXT("127.0.0.1:%d"), NewDeviceInfo.HostMessageBusPort));
}
// Add reverse port forwarding
uint16 ReversePortMappings[] = {
41899, // Network file server, DEFAULT_TCP_FILE_SERVING_PORT in NetworkMessage.h
1980, // Unreal Insights data collection, TraceInsightsModule.cpp
0 // end of list
};
for (int32 Idx=0; ReversePortMappings[Idx] > 0; Idx++)
{
FString DeviceCommand = FString::Printf(TEXT("-s %s reverse tcp:%d tcp:%d"), *NewDeviceInfo.SerialNumber, ReversePortMappings[Idx], ReversePortMappings[Idx]);
// It doesn't really matter if a mapping already exists. There is no listening local port so no contention between multiple editor instances
ExecuteAdbCommand(*DeviceCommand, nullptr, nullptr);
}
}
// add the device to the map