We are working on a Project where we check the internet connectivity and we need to handle exceptions

  1. We wish to implement try and catch… so how to use it in Unreal Engine. Will Assertion Macros work? and if yes then how to use it?
  2. We are trying to check internet connectivity in our code by ping method bt we wish to check it without ping method as we don’t want cmd window appear on the screen. We have tried this code by using OnlineSubsystem method but it doesnt

hello everybuddy , i got the solution . thank u so much.

I have the same problem (problem no 2). Would you please tell me the solution?

same here , a solution will really be appreciated.

i tried to hit socket to check whether the system having internet connectivity or not and it worked for me. :slight_smile:

this would help you

FSocket* Socket = ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM)->CreateSocket(NAME_Stream, TEXT(“default”), false);
FString address = TEXT(“172.217.24.110”);
int32 port = 80;

FIPv4Address::Parse(address, ip);

TSharedRef addr = ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM)->CreateInternetAddr();
addr->SetIp(ip.Value);
addr->SetPort(port);
bool connected = Socket->Connect(*addr);

Works like a charm, at least on desktop. Many thanks!
Also simpler to implement than other solutions I’ve found (at least if you are familiar with C++).

Will report back if this also works on mobile, just if others are curious.

EDIT: Does also work on Android :slight_smile: