Hi all!
My problem is very simple, I need to send custom data from one project to another using UDP, I modified the famous Rama tutorial;
The following code works perfectly on Windows (using “192.168.1.2” as the IP address where I will send the data) but return false on Android (at least on my Moto Z Play running Android 6.0.1).
It’s the EXACT same project, the first time running on Windows, the second time running on Android.
Is there a specific reason why RemoteAddr->SetIp should return false with “192.168.1.2”?
Are there some obscure Android limitations about UDP?
(I had problems with UDP using Data then I found out it’s blocked by some ISPs, but I’m doing this on Wifi)
bool UUDPSender::StartUDPSender(const FString& TheIP)
{
//Create Remote Address.
RemoteAddr = ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM)->CreateInternetAddr();
bool bIsValid;
RemoteAddr->SetIp(*TheIP, bIsValid);
RemoteAddr->SetPort(8990);
if (!bIsValid)
{
return false;
}
SenderSocket = FUdpSocketBuilder("RemoteAndroidSenderSocket").AsReusable().WithBroadcast();
int32 SendSize = 2 * 1024 * 1024;
SenderSocket->SetSendBufferSize(SendSize, SendSize);
SenderSocket->SetReceiveBufferSize(SendSize, SendSize);
return true;
}