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"

How to implement FSockets in 4.10?

I'm hardly trying to debug this... but it actually turns out beeing ridiculous... So first let me describe what I'm actually doing. I tryed to implement this tutorial: http://www.osnapgames.com/2014/05/24/connecting-to-a-third-party-socket-server-in-unreal-engine-4/

Not really with any kind of sucess.... As they even lack alot of informations about what to include and add and so on. I foudn by googling this project (https://github.com/moritz-wundke/UnrealRemote) which I tryed to extract some informations from about how to implement the idea of the previous tutorial.

Some implementatiosn seem to jsut have changed their interface (seriously, ue is changing whole interfaces even within minor versions? Or am I getting soemthing wrong here?). And all of them failed to be included. After reading the 10 similiar post with kinda the some problem but none satisfying answers on any of them, I just tryed the absolute paths for those includes. And tryed to harden the code step by step to see what line produces which errors. But allready after 3 lines I came to a point that is just inacceptable...

my code actually looks like this:

.h file

 #pragma once
 #include <Runtime/Sockets/Public/Sockets.h>
 #include <Runtime/Networking/Public/Networking.h>
 #include <Runtime/Sockets/Public/SocketSubsystem.h>

 class GONLINE_API ChatSocketHandler
     void initConnection();
     FSocket* Socket;

and the .cpp

 #include "GOnline.h"
 #include "ChatSocketHandler.h"



 void ChatSocketHandler::initConnection()
     Socket = ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM)->CreateSocket(NAME_Stream, TEXT("default"), false);
     FString address = TEXT("");
     int32 port = 10615;
     FIPv4Address ip;
     FIPv4Address::Parse(address, ip);
     TSharedRef< FInternetAddr > addr = ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM)->CreateInternetAddr();

Herea lot strange stuff is going on. As soon I add the line declaring addr I'm refering to Networking.h which try to resolve other includes which aren't a absolute link and therefor aren't found. I could fix this by just manually replacing each include of the ue4 recursively by the include and its path prefix. but thats surely not intended. so how to configure it that I don't require absolute paths(by absolute I mean the path prefixed offset.)

also strange was, when I worked around this, addr of type FInternetAddr * didn't have the set of methods implemented as the documents say. my addr did just know the Get method. how can that be? (probably because of wrong use of TSharedRef... But no idea.

and even the FIPv4Address when it was implemented internally complained about not knowing the declaration of IPv4SubnetMask and this is comming along with a lot of other unkown implementation errors, which probably all origin in the include problem rpevious explained. So help me plz... how to fix this?

Product Version: UE 4.10
more ▼

asked May 22 '16 at 12:43 PM in C++ Programming

avatar image

23 3 5

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

1 answer: sort voted first

Sry Posted in your Question that was linked in this Post (btw it should solve you Pathproblem too look it up)


more ▼

answered May 28 '16 at 09:03 AM

avatar image

6.9k 143 26 172

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
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