Where can I find the implementation for FSocket.Send(...)?

Hey there,

I recently played with a re-post I found here:

I have a problem in understanding, how to use this line:

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

I setup a listening TCP client very close to this one:
A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums,Receive_Binary_Data_From_an_IP/Port_Into_UE4,(Full_Code_Sample)

The sending was initially done via a small python script, which was working like a charm. Now trying to have an UE4 Scene sending via FSocket is sadly leading nowhere at the moment, since I found, that its implementation looks like this:

UE_4.15/Engine/Source/Runtime/Sockets/Private/Sockets.cpp like 19:

bool FSocket::Send(const uint8* Data, int32 Count, int32& BytesSent)
{
//	NETWORK_PROFILER(GNetworkProfiler.TrackSocketSend(this,Data,BytesSent));
	UE_LOG(LogSockets, Verbose, TEXT("Socket '%s' Send %i Bytes"), *SocketDescription, BytesSent );
	return true;
}

So my code runs like it should, but without any logic actually sending my data anywhere, it will never work :frowning:

Could anybody please give me a hint, how I can setup a TCP connection and SEND data, instead of just calling an empty method? Or is there an implementation somewhere else and I don’t see it? It looks like, there is something here, I completely don’t understand…

Hello,

When you call:

FSocket* Socket = ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM)->CreateSocket

You are asking for a platform specific version of a FSocket. My guess is the FSocket::Send( ) isn’t the actual function being used when you get the socket. In visual studio, put a break point at:

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

Then, debug through and jump into which Send( ) it’s actually using. If it is using the FSocket::Send and effectively not sending anything, write up a bug report in the Bug Reports section.