TCP Socket Listener, Receiving Binary Data into UE4 From a Python Script!

Hi ,
thanks for putting up so many awesome tutorials.

To make the network code work with the current stable version of UE4 a few little things need to be changed:
**
Within the Header:**

bool StartTCPReceiver(const FString& YourChosenSocketName, const FString& TheIP, const int32 ThePort);
FSocket* CreateTCPConnectionListener(const FString& YourChosenSocketName, const FString& TheIP, const int32 ThePort, const int32 ReceiveBufferSize = 2*1024*1024);
void TCPConnectionListener();
void TCPSocketListener();
bool FormatIP4ToNumber(const FString& TheIP, uint8 (&Out)[4]);
FString StringFromBinaryArray(const TArray<uint8>& BinaryArray);
void LaunchNetwork();

virtual void BeginDestroy(); // without this, the code runs well – once. The second time, the Editor crashes.

//  TCP networking
FSocket* ListenerSocket;
FSocket* ConnectionSocket;
FIPv4Endpoint RemoteAddressForConnection;
FTimerHandle tcpSocketListenerTime_handler; // NEW
FTimerHandle tcpConnectionListenerTime_handler; // NEW

**
Within the cpp file:**

in StartTCPReceiver()

//Start the Listener! //thread this eventually
GetWorldTimerManager().ClearTimer(tcpConnectionListenerTime_handler); // properly initialize
GetWorldTimerManager().SetTimer(tcpConnectionListenerTime_handler, this, &::ATCPTestCharacter::TCPConnectionListener, 0.01, true); // SetTimer now needs an FTimerHandle

Basically the same for TCPConnectionListener()
//can thread this too
GetWorldTimerManager().ClearTimer(tcpSocketListenerTime_handler); // properly initialize
GetWorldTimerManager().SetTimer(tcpSocketListenerTime_handler, this, &ATCPTestCharacter::TCPSocketListener, 0.01, true); // SetTimer now needs an FTimerHandle

void ATCPTestCharacter::BeginDestroy() //clean up to prevent crashing the Editor
{
// Call the base class
Super::BeginDestroy();
UE_LOG(LogTemp, Warning, TEXT(“Closing Sockets”));
if(ListenerSocket!=nullptr) {
ListenerSocket->Close();
ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM)->DestroySocket(ListenerSocket);
}

if(ConnectionSocket!=nullptr) {
    ConnectionSocket->Close();
    ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM)->DestroySocket(ConnectionSocket);
}

}

//Blinky0815