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.
| Part | Role | Main classes |
|---|---|---|
| Manager | Starting, sending, closing, and event dispatch | UObjectDelivererManager |
| Protocol | The communication method | UProtocolFactory and protocol classes |
| PacketRule | The packet division rule | UPacketRuleFactory and rule classes |
| DeliveryBox | Send/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.
| Input | Description |
|---|---|
| Is Event With Game Thread | When true (default), events are processed on the game thread |
| Output | Description |
|---|---|
| Return Value | The 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.
| Input | Description |
|---|---|
| Protocol | The communication method |
| Packet Rule | The packet division rule |
| Delivery Box | The 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.
| Input | Description |
|---|---|
| Data Buffer | The 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.
| Input | Description |
|---|---|
| Data Buffer | The byte array to send |
| Target | The 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
| Event | When it fires | Parameters |
|---|---|---|
| Connected | Connection is ready | ClientSocket the connected peer |
| Disconnected | Connection is lost | ClientSocket the disconnected peer |
| ReceiveData | Data is received | ClientSocket the sender, Buffer the received bytes |
Protocol
Protocols are created with UProtocolFactory nodes and passed to Start.
UProtocolFactory node list
| Node | Main inputs | Description |
|---|---|---|
| Create Protocol Tcp Ip Client | IpAddress, Port, Retry, Auto Connect After Disconnect | TCP/IP client |
| Create Protocol Tcp Ip Server | Port | TCP/IP server |
| Create Protocol Tcp Ip Client Tls | IpAddress, Port, Retry, Auto Connect After Disconnect, Minimum Protocol | TLS-encrypted TCP/IP client (v1.9.0 and later) |
| Create Protocol Tcp Ip Server Tls | Port, CertPath, KeyPath, Minimum Protocol | TLS-encrypted TCP/IP server (v1.9.0 and later) |
| Create Protocol Udp Socket Sender | IpAddress, Port | UDP send only |
| Create Protocol Udp Socket Sender with Broadcast | IpAddress, Port, Enable Broadcast | UDP send only with broadcast |
| Create Protocol Udp Socket Receiver | Bound Port | UDP receive only |
| Create Protocol Shared Memory | Shared Memory Name, Shared Memory Size | Shared memory (Windows only) |
| Create Protocol Log Writer | File Path, Path Is Absolute | File writer |
| Create Protocol Log Reader | File Path, Path Is Absolute, Cut First Interval | File reader |
| Create Protocol Reflection | None | Reflection (for debugging) |
| Create Protocol Web Socket Client | Url | WebSocket client (v1.7.0 and later) |
| Create Protocol Web Socket Client with Protocols | Url, Protocols | WebSocket client with sub-protocols |
| Create Protocol Web Socket Client with Headers | Url, Protocols, Headers | WebSocket 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.
| Node | Description |
|---|---|
| Initialize variants | Initialize directly when spawning the object, instead of using Create Protocol |
| With Receive Buffer Size | Specify the receive buffer size in bytes |
| With Send Buffer Size | Specify 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
| Node | Description |
|---|---|
| Set Auto Reconnect | Set whether to reconnect automatically after disconnection |
| Set Reconnect Delay | Set 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.
| Node | Description |
|---|---|
| With Pinned Public Key | Pin the expected server public key by its SHA-256 fingerprint |
| With Pinned Public Key From File | Specify a file that contains the fingerprint |
| With Client Certificate | Specify the client certificate and private key paths for mTLS |
| With Certificate Verification | Enable standard certificate verification |
| With Trusted Ca Certificate | Specify a trusted CA certificate path (for a private CA) |
| With Peer Verification Disabled | Disable server certificate verification (not recommended; see the production page) |
| With Allow Self Signed Certificates | Allow self-signed certificates |
| Get Last Tls Error | Get 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)
| Node | Description |
|---|---|
| With Client Auth Mode | Set whether client certificates are requested, using EObjectDelivererClientAuthMode |
| With Client Ca Bundle | Specify the CA bundle path used to verify client certificates |
PacketRule
PacketRules are created with UPacketRuleFactory nodes.
| Node | Inputs | Description |
|---|---|---|
| Create Packet Rule Fixed Length | Fixed Size | Split into fixed-size packets |
| Create Packet Rule Size Body | Size Length, Size Buffer Endian | Prefix a size header |
| Create Packet Rule Terminate | Terminate | Split at a terminator (default is \r\n) |
| Create Packet Rule Nodivision | None | No 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.
| Node | Inputs | Description |
|---|---|---|
| Create Object Delivery Box Using Json | Target Class | Convert UObjects to JSON |
| Create Dynamic Object Delivery Box Using Json | None | Handle multiple types with class names in JSON |
| Create Custom Object Delivery Box Using Json | Default Serializer Type, Object Serializer Types, Target Class | Set the serialization method per class |
| Create Utf8String Delivery Box | None | Send and receive UTF-8 strings as they are |
UObjectDeliveryBoxUsingJson nodes
| Node | Inputs | Output / event |
|---|---|---|
| Initialize | Target Class | Set the target class |
| Initialize Custom | Default Serializer Type and more | Set the serialization method per class |
| Send | message (UObject) | maked Json the generated JSON string |
| SendTo | message, Destination | maked 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
| Node | Inputs | Output / event |
|---|---|---|
| Send | message (FString) | None |
| SendTo | message, Destination | None; 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.
| Parameter | Description |
|---|---|
| Message | The log message |
| Verbosity | EODLogVerbosity (Fatal to VeryVerbose) |
| Category | The log category |
Use it to investigate communication that does not behave as expected. Custom loggers can be created by inheriting UObjectDelivererLoggerBase.
Enums
| Enum | Values | Purpose |
|---|---|---|
| EObjectDelivererTlsProtocol | TLSv1_2 / TLSv1_1 (deprecated) / TLSv1_0 (deprecated) | Minimum TLS version (higher versions allowed) |
| EObjectDelivererClientAuthMode | None / Optional / Required | Client certificate request on the TLS server |
| ECNBufferEndian | Big / Little | Endianness of the SizeBody size header |
| EODJsonSerializeType | NoWriteType / WriteType | Whether to include the class name in JSON |
| EODLogVerbosity | Fatal to VeryVerbose | Log 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
- Keep the manager created with
Create Object Deliverer Managerin a member variable. - The Protocol, PacketRule, and DeliveryBox passed to
Startare retained internally by the manager during communication. When you use theReceivedevent of a DeliveryBox, also store the DeliveryBox itself in a variable for the event binding. - With a TCP/IP server or a UDP receiver, manage destinations using the
ClientSocketof theConnectedevent andConnectedList.SendTosends to a specific destination. - Call
Closewhen communication is no longer needed. If the object is destroyed without calling it, connections may remain.