Freeze when using FTcpListener?


I am trying to use an FTcpListener in a file server.

My problem is that the game freezes as soon as i call the FTcpListener::Run() function.

I couldn’t find any example of how to use this class in google or in the ShooterGame.

Debugging tells me that i am stuck in the while(!Stopping) loop of TcpListener.h (line 149).

Here is my code:

void UYagFileServer::Start(uint32 ServerPort)
	// server only
	if (FileServerGameState->Role < ROLE_Authority) return;

	// listening socket
	FIPv4Endpoint Endpoint(FIPv4Address(127, 0, 0, 1), ServerPort);
	ListenerSocket = FTcpSocketBuilder("ServerListeningSocket")

	//Set Buffer Size
	int32 ReceiveBufferSize = 2 * 1024 * 1024;
	int32 NewSize = 0;
	ListenerSocket->SetReceiveBufferSize(ReceiveBufferSize, NewSize);

	YagTcpListener = new FTcpListener(*ListenerSocket);
	YagTcpListener->OnConnectionAccepted().BindUObject(this, &UYagFileServer::ListenToMessage);
	// the game freezes when i run this line:
	if (YagTcpListener->Init())	YagTcpListener->Run();

The listener is listening all right though:


Am i doing anything wrong ?



Ok, some progress, i didn’t know i didn’t need to call the run function, that’s why i got stuck^^