I’m using self-written C# WPF application to control UE level in play mode (visualizing some stats). One of the app features - controlling UE level that is started on other PC available on LAN.
PUT requests are sending by C# System.Net.Http.HttpClient that is configured next way:
HttpClient = new HttpClient();
HttpClient.Timeout = TimeSpan.FromSeconds(5);
HttpClient.BaseAddress = new Uri(BaseUri + _Endpoints["ObjectFunction"]);
HttpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
BaseUri consists of “http://MACHINE_IP:30010” where MACHINE_IP is localhost or IP of second machine in LAN.
_Endpoints[“ObjectFunction”] is /remote/object/call
When I’m controlling UE level in PIE on localhost (i.e. my controller app and Unreal are started on same machine) - it work perfect.
When I’m controlling UE level on other machine in LAN (IP is 10.0…) - it catches few request (i.e. they are accepted and needed changes appears in level) and then I start catching timeouts on all further requests.
Timeouts continues until I restart my controller app or “reset” HttpClient by same method as I mentioned above:
HttpClient = new HttpClient();
HttpClient.Timeout = TimeSpan.FromSeconds(5);
HttpClient.BaseAddress = new Uri(BaseUri + _Endpoints["ObjectFunction"]);
HttpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
“Reset” happens via special button in my app so it can be performed “on runtime”.
After such reset, UE catches few request and starts timeouting again.
Interesting moment is that I tried to make few calls from Postman on first LAN PC to UnrealEngine on second LAN PC and it works great - timeout never occured.
My “config”:
- Two PC’s in one LAN network, both with turned off firewall. No additional network filtration soft/hardware.
- UE 4.27 on both.
- Add following to Engine/Config/BaseEngine.ini:
[HTTPServer.Listeners]
DefaultBindAddress=0.0.0.0 - Start PIE of needed level in new window on one PC
- Send few (2-10) requests from application (own-writed, but it can be simplest console solution)
Can it be a problem from UE side? Maybe listener is recognizing HttpClient instance by some signature as untrusted after few requests or smth? Or should I take a look at HttpClient configuring?