x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

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

Hey there,

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

https://wiki.unrealengine.com/Third_Party_Socket_Server_Connection

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: https://wiki.unrealengine.com/TCP_Socket_Listener,_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 :(

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..

Product Version: UE 4.15
Tags:
more ▼

asked May 04 '17 at 07:25 AM in C++ Programming

avatar image

infected.digital
6 1 2 1

avatar image ImVawx ♦♦ STAFF May 04 '17 at 06:27 PM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question