I want to test whether the server ip can be pinged before connecting. Below is my code:
FModuleManager::Get().LoadModuleChecked(FName("Icmp"));
TFunction<void(FIcmpEchoResult)> Callback=[=](FIcmpEchoResult Result)
{
bool bSuccess=Result.Status==EIcmpResponseStatus::Success;
UE_LOG(LogTemp,Warning,TEXT("IP:%s is %s"),*IP,bSuccess?TEXT("available"):TEXT("not available"));
};
FUDPPing::UDPEcho(IP,3.f,Callback);
I can ping this ip using the command prompt,But the status code of the result returned by the callback function is InternalError.
please help me. thanks very mush!!