The project i am working on requires a TCP connection to the server. When a client connects to a session, how would I be able to get the ip address of the session connection to use to create my TCP connection?
In pure UE4 you can do this only via C++, in programming raw TCP/UDP network communication is usually called “sockets” (don’t mistake with HTML Sockets which work bit different with incorporation of HTTP) so search using that name
UE4 has dedicated module for raw network communication called (supprice) “sockets”, here API refrence:
Here oyu got some use examples from wiki
A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums,Receive_Binary_Data_From_an_IP/Port_Into_UE4,(Full_Code_Sample)
A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums
If you plan using HTTP, UE4 has also dedicated module for that so you don’t need to use raw TCP communication for it, here anwser that i posted in past showing how to use it
and i know UE4 plugin called VaRest which enables HTTP communication in blueprint with JSON parsing included
I already know how to use sockets in eu4 for the most part. the only thing I need to know is how to connect my TCP socket to the session the client has connected to. specifically, I need the FInternetAddr that the client is connecting to.
Side question: Would be better for the client to create a listen socket and connect to that from the server? Either way, I need the FInternetAddr of the connection.
You can use
FString GetPlayerNetworkAddress(); FString GetServerNetworkAddress();
functions of PlayerController
I think that’s exactly what I am looking for.