void AUdpActor::RecvData(const FArrayReaderPtr & ArrayReadPrt, const FIPv4Endpoint & EndPt)
{
//FString msg;
GLog->Logf(TEXT(“Receiver msg”));
}
void AUdpActor::SendData(FString str)
{
if (!isStartUdpSucessful) return;
int32 sendNum = 0;
FString serialized = str;
TCHAR *serializedChar = serialized.GetCharArray().GetData();
int32 size = FCString::Strlen(serializedChar);
UdpSenderSocket->SendTo((uint8*)TCHAR_TO_UTF8(serializedChar), size, sendNum,*RemoteAddr);
if (sendNum <= 0)
{
const FString Str = "Socket is valid but the receiver received 0 bytes, make sure it is listening properly!";
GLog->Logf(TEXT("warning : %s"), *Str);
}
else
{
GLog->Logf(TEXT("send str : %s"), *str);
}
}