Trying to code Third Party Socket Server Connection

Hello, I’m trying to make Third Party Socket Server Connection working with C#. I’m currently updated to newest UE 4.9.2, but I got some troubles, because of the lack of knowledge coding. Found this tutorial A new, community-hosted Unreal Engine Wiki - Announcements and Releases - Unreal Engine Forums But not sure where I should put all this code (in which file or files…)


FSocket* Socket = ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM)->CreateSocket(NAME_Stream, TEXT("default"), false);


FString address = TEXT("127.0.0.1");
int32 port = 19834;
FIPv4Address ip;
FIPv4Address::Parse(address, ip);


TSharedRef addr = ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM)->CreateInternetAddr();
addr->SetIp(ip.GetValue());
addr->SetPort(port);


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


FString serialized = TEXT("loadPlayer|1");
TCHAR *serializedChar = serialized.GetCharArray().GetData();
int32 size = FCString::Strlen(serializedChar);
int32 sent = 0;


bool successful = Socket->Send((uint8*)TCHAR_TO_UTF8(serializedChar), size, sent);


Also maybe someone knows where I could find maybe better tutorials or better explained how to do this. I have been searching the net for some time didn’t found something better ;/ Except a whole bunch of blueprint tutorials related to networking, but I want to make it written in code :slight_smile: Thank you for your time!!! :slight_smile: