Download

This code doesn't work on ios platform. 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

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

I use UE4.10 version

IP address is Reverse order. Is that problem?

I need to run ios version but when I create host it will be failed and other platform is fine. How to fix it?

Might be a little/big endian related problem?

Maybe, but how to fix it? my app can work on 4.92 for ios . Just UE4.10 has this problem

Maybe, but how to fix it? my app can work on 4.92 for ios . Just UE4.10 has this problem.