Download

This code doesn't work on ios platform. and on others platform(pc, mac,android) is OK. Why?

LANBeacon.cpp →

ListenAddr = SocketSubsystem->GetLocalBindAddr(*GWarn);
ListenAddr->SetPort(Port);
// A temporary “received from” address
SockAddr = SocketSubsystem->CreateInternetAddr();
ListenSocket = SocketSubsystem->CreateSocket(NAME_DGram, TEXT(“LAN beacon”), true);
if (ListenSocket != NULL)
{
ListenSocket->SetReuseAddr();
ListenSocket->SetNonBlocking();
ListenSocket->SetRecvErr();
// Bind to our listen port
if (ListenSocket->Bind(*ListenAddr))
{
// Set it to broadcast mode, so we can send on it
// NOTE: You must set this to broadcast mode on Xbox 360 or the
// secure layer will eat any packets sent
bSuccess = ListenSocket->SetBroadcast();
}
else
{
UE_LOG(LogOnline, Error, TEXT(“Failed to bind listen socket to addr (%s) for LAN beacon”),
*ListenAddr->ToString(true));
}
}

output : Failed to bind listen socket to 115.1.168.192:14001 for LAN beacon

The code from UE4.10. it doesn’t work on ios platform. and on others platform(pc, mac,android) is OK. Why?