UE4 FInternetAddr port is set to 0 right after I set it

Viewed 141

I've been trying to set up a local UDP server in Unreal Engine 4 and am running into this port being zeroed out in just a few lines of code.

bool canbind = true;
TSharedPtr<class FInternetAddr> ListenAddr = Sockets->GetLocalHostAddr(*GWarn, canbind);
ListenAddr->SetPort(27115);
TArray<uint8> rawIp = ListenAddr->GetRawIp(); // <-- This is 192.168.0.17 as expected
int32 port = ListenAddr->GetPort(); // <-- This is 0, unexpectedly

Let me know if you can see anything that would cause this to be 0. I've also tried with GetLocalBindAddr to an identical result.

0 Answers
Related