ObjectDeliverer Blueprint API Reference

This page documents the API that ObjectDeliverer exposes to Blueprint. The same API is available from C++. For guidance on choosing between the parts, see the Use Cases page.

How the API fits together

The ObjectDeliverer API consists of four parts.

PartRoleMain classes
ManagerStarting, sending, closing, and event dispatchUObjectDelivererManager
ProtocolThe communication methodUProtocolFactory and protocol classes
PacketRuleThe packet division ruleUPacketRuleFactory and rule classes
DeliveryBoxSend/receive data conversion (optional)UDeliveryBoxFactory and box classes
    flowchart TB
	  M["ObjectDelivererManager<br>Start / Send / Close"] --> P["Protocol"]
	  M --> R["PacketRule"]
	  M --> D["DeliveryBox (optional)"]
	  D -->|"Send / Received"| M
	  P -->|"Connected / Disconnected / ReceiveData"| M

UObjectDelivererManager

This class manages the whole communication. Keep a reference to it from Start until Close.

Create Object Deliverer Manager

Creates the manager.

InputDescription
Is Event With Game ThreadWhen true (default), events are processed on the game thread
OutputDescription
Return ValueThe created manager

Store the return value in a member variable. If it is not referenced anywhere, it becomes a garbage collection target and communication stops.

Start

Starts communication.

InputDescription
ProtocolThe communication method
Packet RuleThe packet division rule
Delivery BoxThe data conversion method (optional; byte arrays when omitted)

If communication is already running, call Close before starting again.

Close

Ends communication and releases connections and resources. All connected clients are disconnected. Call it when the level ends (in EndPlay).

Send

Sends data to all connected destinations.

InputDescription
Data BufferThe byte array to send

SendTo

Sends data only to the specified destination. Use it with a TCP/IP server to send to a specific client.

InputDescription
Data BufferThe byte array to send
TargetThe destination object received in the Connected event

IsConnected

Returns whether the manager is connected (true: connected, false: disconnected).

ConnectedList

The read-only list of currently connected destination objects. Use it when a TCP/IP server handles multiple clients.

With Object Deliverer Logger

Attaches a logger described in Logging. The return value is the manager itself, so you can chain the call right after creation. Pass nullptr to detach.

Is Event With Game Thread

Whether events are processed on the game thread (default: true). This is the same setting as the argument of Create Object Deliverer Manager.

Events

EventWhen it firesParameters
ConnectedConnection is readyClientSocket the connected peer
DisconnectedConnection is lostClientSocket the disconnected peer
ReceiveDataData is receivedClientSocket the sender, Buffer the received bytes

Protocol

Protocols are created with UProtocolFactory nodes and passed to Start.

UProtocolFactory node list

NodeMain inputsDescription
Create Protocol Tcp Ip ClientIpAddress, Port, Retry, Auto Connect After DisconnectTCP/IP client
Create Protocol Tcp Ip ServerPortTCP/IP server
Create Protocol Tcp Ip Client TlsIpAddress, Port, Retry, Auto Connect After Disconnect, Minimum ProtocolTLS-encrypted TCP/IP client (v1.9.0 and later)
Create Protocol Tcp Ip Server TlsPort, CertPath, KeyPath, Minimum ProtocolTLS-encrypted TCP/IP server (v1.9.0 and later)
Create Protocol Udp Socket SenderIpAddress, PortUDP send only
Create Protocol Udp Socket Sender with BroadcastIpAddress, Port, Enable BroadcastUDP send only with broadcast
Create Protocol Udp Socket ReceiverBound PortUDP receive only
Create Protocol Shared MemoryShared Memory Name, Shared Memory SizeShared memory (Windows only)
Create Protocol Log WriterFile Path, Path Is AbsoluteFile writer
Create Protocol Log ReaderFile Path, Path Is Absolute, Cut First IntervalFile reader
Create Protocol ReflectionNoneReflection (for debugging)
Create Protocol Web Socket ClientUrlWebSocket client (v1.7.0 and later)
Create Protocol Web Socket Client with ProtocolsUrl, ProtocolsWebSocket client with sub-protocols
Create Protocol Web Socket Client with HeadersUrl, Protocols, HeadersWebSocket client with custom headers

See the corresponding sections of Use Cases for the behavior and typical usage of each protocol.

Nodes common to protocol objects

Each protocol object (the return type of a Create Protocol ... node) provides the following nodes, except for a few protocols.

NodeDescription
Initialize variantsInitialize directly when spawning the object, instead of using Create Protocol
With Receive Buffer SizeSpecify the receive buffer size in bytes
With Send Buffer SizeSpecify the send buffer size in bytes

The With ... nodes return the protocol itself, so calls can be chained. The default buffer size is 1 MB.

GetIPAddress / GetIPAddressInString

Available on TCP/IP protocol objects and on destinations (ClientSocket) accepted by a server. Returns the IP address as bytes or as a string. Use it to identify the sender.

Additional WebSocket client nodes

NodeDescription
Set Auto ReconnectSet whether to reconnect automatically after disconnection
Set Reconnect DelaySet the wait in seconds before reconnecting

Additional TLS client nodes (UProtocolTcpIpClientTls)

The return value of Create Protocol Tcp Ip Client Tls provides nodes that configure certificate verification.

NodeDescription
With Pinned Public KeyPin the expected server public key by its SHA-256 fingerprint
With Pinned Public Key From FileSpecify a file that contains the fingerprint
With Client CertificateSpecify the client certificate and private key paths for mTLS
With Certificate VerificationEnable standard certificate verification
With Trusted Ca CertificateSpecify a trusted CA certificate path (for a private CA)
With Peer Verification DisabledDisable server certificate verification (not recommended; see the production page)
With Allow Self Signed CertificatesAllow self-signed certificates
Get Last Tls ErrorGet the reason of the most recent TLS connection failure as a string

Get Last Tls Error reports handshake failures (for example, a chain signed by a distrusted CA), certificate or CA configuration failures, and connections that drop right after the handshake. It is cleared once a connection is established.

Additional TLS server nodes (UProtocolTcpIpServerTls)

NodeDescription
With Client Auth ModeSet whether client certificates are requested, using EObjectDelivererClientAuthMode
With Client Ca BundleSpecify the CA bundle path used to verify client certificates

PacketRule

PacketRules are created with UPacketRuleFactory nodes.

NodeInputsDescription
Create Packet Rule Fixed LengthFixed SizeSplit into fixed-size packets
Create Packet Rule Size BodySize Length, Size Buffer EndianPrefix a size header
Create Packet Rule TerminateTerminateSplit at a terminator (default is \r\n)
Create Packet Rule NodivisionNoneNo splitting or combining

Both the sender and the receiver must use the same rule. See Switching the packet fragmentation rules for details.

DeliveryBox

DeliveryBoxes are created with UDeliveryBoxFactory nodes and passed to the DeliveryBox input of Start.

NodeInputsDescription
Create Object Delivery Box Using JsonTarget ClassConvert UObjects to JSON
Create Dynamic Object Delivery Box Using JsonNoneHandle multiple types with class names in JSON
Create Custom Object Delivery Box Using JsonDefault Serializer Type, Object Serializer Types, Target ClassSet the serialization method per class
Create Utf8String Delivery BoxNoneSend and receive UTF-8 strings as they are

UObjectDeliveryBoxUsingJson nodes

NodeInputsOutput / event
InitializeTarget ClassSet the target class
Initialize CustomDefault Serializer Type and moreSet the serialization method per class
Sendmessage (UObject)maked Json the generated JSON string
SendTomessage, Destinationmaked Json the generated JSON string; sends to one destination
Received—Received Object the restored object, Received Json String the JSON, From Object the sender

UUtf8StringDeliveryBox nodes

NodeInputsOutput / event
Sendmessage (FString)None
SendTomessage, DestinationNone; sends to one destination
Received—Received String the received string, From Object the sender

Logging

After attaching a UObjectDelivererLogger to a manager with With Object Deliverer Logger, internal plugin logs are delivered to Blueprint.

The On Log Message event has the following parameters.

ParameterDescription
MessageThe log message
VerbosityEODLogVerbosity (Fatal to VeryVerbose)
CategoryThe log category

Use it to investigate communication that does not behave as expected. Custom loggers can be created by inheriting UObjectDelivererLoggerBase.

Enums

EnumValuesPurpose
EObjectDelivererTlsProtocolTLSv1_2 / TLSv1_1 (deprecated) / TLSv1_0 (deprecated)Minimum TLS version (higher versions allowed)
EObjectDelivererClientAuthModeNone / Optional / RequiredClient certificate request on the TLS server
ECNBufferEndianBig / LittleEndianness of the SizeBody size header
EODJsonSerializeTypeNoWriteType / WriteTypeWhether to include the class name in JSON
EODLogVerbosityFatal to VeryVerboseLog severity

C++ implementation example

The following example implements a TCP server in C++. It uses the same parts as the Blueprint configuration.

void UMyClass::Start()
{
    auto deliverer = UObjectDelivererManager::CreateObjectDelivererManager();

    // Set up event handlers
    deliverer->Connected.AddDynamic(this, &UMyClass::OnConnect);
    deliverer->Disconnected.AddDynamic(this, &UMyClass::OnDisConnect);
    deliverer->ReceiveData.AddDynamic(this, &UMyClass::OnReceive);

    // Start communication
    // Protocol: TCP/IP server
    // Division rule: header (size) + body
    // Serialization: byte array
    deliverer->Start(UProtocolFactory::CreateProtocolTcpIpServer(9099),
                     UPacketRuleFactory::CreatePacketRuleSizeBody());
}

void UMyClass::OnConnect(UObjectDelivererProtocol* ClientSocket)
{
    // Send data
    TArray<uint8> buffer;
    deliverer->Send(buffer);
}

void UMyClass::OnDisConnect(UObjectDelivererProtocol* ClientSocket)
{
    // Handle disconnection
    UE_LOG(LogTemp, Log, TEXT("closed"));
}

void UMyClass::OnReceive(UObjectDelivererProtocol* ClientSocket, const TArray<uint8>& Buffer)
{
    // Handle received data
}

Lifecycle and retention summary

  1. Keep the manager created with Create Object Deliverer Manager in a member variable.
  2. The Protocol, PacketRule, and DeliveryBox passed to Start are retained internally by the manager during communication. When you use the Received event of a DeliveryBox, also store the DeliveryBox itself in a variable for the event binding.
  3. With a TCP/IP server or a UDP receiver, manage destinations using the ClientSocket of the Connected event and ConnectedList. SendTo sends to a specific destination.
  4. Call Close when communication is no longer needed. If the object is destroyed without calling it, connections may remain.