Creating BP nodes, TSharedRef not working??

I managed to figure out the line needed to be:



TSharedRef<FInternetAddr> addr = ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM)->CreateInternetAddr();


So now it builds without error.

However I set up a widget with a button, that when clicked calls this BP node, then prints out the return string just to make sure it is going all the way through the code. It crashed first time running it. It seems the



bool connected = Socket->Connect(*addr);


Causes the crash/lockup. I commented it out, and it all works fine, or at least comes out with the printed string, so nothing crashed.

Any ideas?


I should add the whole idea here is to build a little ‘master server’ that a host connects to, registers itself it it does not already exist, provides maxplayers, numplayers, and other such data, and the master server checks for a heartbeat to make sure host is alive. Then clients can query the master server for a list of active servers (sort of a replacement for ‘findsessions’ if mode is not set to LAN …

If anyone has any experience with such things or wants to help out, it would be appreciated. Plan to just build a basic system for all to use that do not want to deal with Steam for whatever reason.

1 Like