UDP Socket Sender Receiver From One UE4 Instance To Another

Overview Author: () www.ue4code.com In this tutorial I give you the core code for how you can send any custom data structure you want, BP-exposed, from one instance of UE4 to another! The implicati...

Updated over 4 years ago Edit Page Revisions

Overview

Author: () www.ue4code.com

In this tutorial I give you the core code for how you can send any custom data structure you want, BP-exposed, from one instance of UE4 to another!

The implications are vast, the use cases are nearly infinite!

You can send any data you want from any 1 UE4 instance to any other!

px=900 px=900

Setup

Below are two actor classes, you should spawn 1 in your sending instance of UE4 and 1 in your receiving instance of UE4, of the respective types.

The reason they are actors is to allow them to be easily blueprintable and have async BP event responses via BlueprintImplementable event.

I used this ip,port

IP = 127.0.0.1

Port = 8890

The IP is passed in an FString

Build CS

Make sure to include the extra dependencies!

PublicDependencyModuleNames.AddRange(new string[] {
    "Core", "CoreUObject", "Engine", "InputCore",

     "Sockets", "Networking"   //