This tutorial builds a server Actor and a client Actor in one Level. The client opens a bidirectional stream, sends a string, and receives the echo. No C++ work is involved.
The server side uses the Full Edition server nodes. On the Free Edition you connect to the OmniQUIC Echo Server instead; it is a free Windows app distributed from the download page. The client steps are the same in both editions.
Complete Setup first.
Blueprint layout
flowchart TD
subgraph ServerBP["BP_QUICServer (Full Edition)"]
SB[BeginPlay] --> CS[Create Server → keep in a variable]
CS --> CERT[Make Development Server Certificate]
CERT --> SC["Configure<br/>ALPN omniquic / Port 7777"]
SC --> START[Start]
START --> ACC[On Client Connected]
ACC --> BIND1[Bind the connection's On Stream Started By Peer]
end
subgraph ClientBP["BP_QUICClient"]
CB[BeginPlay] --> CLC[Create Client → keep in a variable]
CLC --> CC["Configure<br/>AcceptAnyCertificate / idle 3000 ms"]
CC --> BIND2[Bind On Connected]
BIND2 --> WAIT[Delay 1.0]
WAIT --> CONN["Connect 127.0.0.1:7777"]
end
CONN -->|QUIC connection| START
BIND2 --> OPEN[Open Bidirectional Stream]
OPEN --> SEND["Send<br/>String To Bytes: hello stream"]
SEND -->|echo| RECV[On Data Received → Bytes To String]
SEND --> SRV[Server: On Data Received → Send back]
SRV -->|echo| RECV
1. Prepare the project
- Create a Level and save it as a test Level.
- Check that UDP port
7777is free. - In the Content Browser, create two Actors from Blueprint Class and name them
BP_QUICServerandBP_QUICClient.
Place both Actors in the same Level. Server and client run in one process, so the destination is 127.0.0.1.
2. Build the server Actor
Open BP_QUICServer and connect nodes from Event BeginPlay in this order.
- Add
Create Serverand store the return value in a variable namedServer, of typeOmniQUICServer. - Check that the return value is valid with
Is Valid, and stop if it is empty. - Add
Make Development Server Certificate. - Create an
OmniQUICServerSettingswithMake Structand set these values.
| Field | Value |
|---|---|
Alpn |
omniquic |
Idle Timeout Ms |
10000 |
Max Connections |
0 (no limit) |
Port |
7777 |
Certificate |
The value from step 3 |
- Pass the settings to
Configureand check the result withIs Error Ok. - Call
Startand check the result withIs Error Ok. On success the server listens on all IPv4 interfaces. - Check
Is Listening.Get Listen Portreports the port that is actually bound.
On Client Connected delivers each accepted connection. In this tutorial the server binds that connection’s On Stream Started By Peer, so it receives the stream the peer opens.
- Place
Bind Eventafter Event BeginPlay, and set its target to the client connection, not to the server. Store theConnectionoutput ofOn Client Connectedand bind itsOn Stream Started By Peer. - Name the bound custom event
HandlePeerStream. Store itsStreamargument in a variable namedEchoStream. - Bind
EchoStream’sOn Data Received, and pass the receivedDatastraight intoEchoStream’sSend.
The server now returns whatever arrives on the stream the client opened. As in the sample, EchoStream is overwritten by each new peer stream, so handle one connection at a time.
In Event EndPlay, call Shutdown to close the listener and the connections.
3. Build the client Actor
Open BP_QUICClient and connect nodes from Event BeginPlay in this order.
- Add
Create Clientand store the return value in a variable namedClient, of typeOmniQUICClient. - Check that the return value is valid with
Is Valid. - Create an
OmniQUICClientSettingswithMake Structand set these values.
| Field | Value |
|---|---|
Alpn |
omniquic |
Validation Policy |
AcceptAnyCertificate |
Idle Timeout Ms |
3000 |
- Pass the settings to
Configureand check the result withIs Error Ok. - Bind
Client’sOn Connected,On DisconnectedandOn Stream Started By Peerto custom events.
AcceptAnyCertificate is what lets the client accept the self-signed development certificate. In production, use SystemTrust with a certificate the system already trusts.
4. Connect
Wait for the server’s Start to finish before connecting, so add a one-second Delay after Configure.
- Add
Connectafter theDelay. - Set
Hostto127.0.0.1andPortto7777. - Check the returned error with
Is Error Ok. A successful return means the attempt was accepted, not that the connection is up. - The connection is up when
On Connectedfires. Log theReasoninOn Disconnected.
If the connection fails, On Connected does not fire. Check Get State, and if it stays Disconnected, verify the Host, the Port and that the server is listening.
5. Open a stream and send
Open the stream from the connection event.
- In the
On Connectedcustom event, callOpen Bidirectional Stream. - The return value is
FOmniQUICStreamOpenResult. StoreStreamin a variable namedStream, and testErrorwithIs Error Ok. - Bind
Stream’sOn Data Received. - Pass
hello streamtoString To Bytesand connect it toSend. LeaveFinish Sendfalse.
Send is an ordinary node, and so is Open Bidirectional Stream; neither is pure. Each open reserves a stream slot, so do not place the open node where a pure node would be re-evaluated.
The server sends the same data back. Pass the received Data to Bytes To String and show it with Print String.
6. Check the result
Press Play. About a second later the connection is established and hello stream is sent. The echo comes back and the same string appears on screen and in the Output Log.
| Where to look | Expected result |
|---|---|
| Connection | On Connected fires once |
Server On Client Connected |
Fires once; Get Remote Address shows 127.0.0.1:... |
Client On Data Received |
hello stream arrives once |
| Output Log | No log entries carrying an error code |
On Data Received fires once per MsQuic receive event, and the bytes are never coalesced or split. A single Send can therefore produce several On Data Received calls, so the receiving side has to handle data that ends mid-message.
7. Shut down
- On the client, call
Closeon the stream. It starts a graceful close, andOn Closedreports completion. - Call
DisconnectonClient.On Disconnectedreports completion. - Call
Shutdownlast. It waits until every handle is closed, so run it where nothing else needs to happen, such as when the Level ends. - On the server, call
Stopto close the listener, thenShutdownto close the connections and the listener.
Disconnect and Stop do not wait. If you need completion before the Level ends, continue from On Disconnected or On Client Disconnected.
Trying it on the Free Edition
The Free Edition does not include Create Server or Make Development Server Certificate. The client side uses the same nodes, and you can connect it to the OmniQUIC Echo Server, a free Windows app that sends back every stream and datagram it receives. You can check the connection and the round trip without building a server.
Start the Echo Server
- Download
OmniQUICEchoServer_1.0.0_windows-amd64.zipfrom the download page. - Unpack the zip. Keep
OmniQUICEchoServer.exein the same folder as the three DLLs (vcruntime140.dll,vcruntime140_1.dll,msvcp140.dll); the app does not start without them. - Double-click
OmniQUICEchoServer.exe. If SmartScreen warns about a freshly downloaded program, choose More info and Run anyway. The executable is signed. - Choose the listen address. Use
127.0.0.1 (this PC only)to connect from Unreal Engine on the same PC, or0.0.0.0 (all interfaces)to connect from another PC. - Set Port. The default is
4433. - Press Start. The status line changes to
Running on <address>:<port>when the server is listening.
The server creates its self-signed certificate when it starts, so there is no certificate to prepare.
With 0.0.0.0 (all interfaces), the line under the address selection lists the LAN addresses other PCs can use. The first run may open a Windows firewall prompt; allow the app on private networks.
Connect from the client
The client steps in this tutorial (3. Build the client Actor through 5. Open a stream and send) work as written on the Free Edition. Only the connection target changes.
| Field | Value |
|---|---|
Host |
127.0.0.1 on the same PC, or a LAN address the server lists |
Port |
4433, or the value you set in Port |
Alpn |
omniquic |
Validation Policy |
AcceptAnyCertificate |
The Echo Server uses a self-signed certificate rather than one from a certificate authority, so connect with AcceptAnyCertificate.
Press Play. The client connects to the Echo Server and whatever it sends comes back. When the same data arrives in On Data Received, the connection and the stream work.
To stop the Echo Server, press Stop in its window. To change the listen address, the port or the certificate, press Stop first, then change the value and press Start again.
Free Edition limits
- You can hold two locally initiated streams open per connection. Going past that fails with
StreamLimitReached. - The process can hold one active client connection at a time. A second concurrent
Connectfails withConnectionLimitReached.
Reference implementation (sample)
The plugin repository contains a reference implementation with the same shape as this tutorial.
| Asset | What it is |
|---|---|
BP_OmniQUICSampleServer |
Actor that runs Create Server through Start and echoes data |
BP_OmniQUICSampleClient |
Actor that opens a bidirectional stream and a datagram endpoint |
L_OmniQUICSample |
Level holding both Actors |
Every graph in the reference implementation is built from stock Blueprint nodes. ALPN is omniquic, the port is 7777, and the behaviour is an echo. The sample uses the server and datagram nodes, so it runs on the Full Edition. Whether the sample is included in the distribution package is not decided yet, so check the package contents once OmniQUIC is released.
Troubleshooting
- Is another process using UDP port
7777, or4433when you connect to the Echo Server? - Is OmniQUIC enabled for this project in Edit → Plugins?
- Does the client connect only after the server’s
Start? - Do the client and the server use the same
Alpn? - Is every created object stored in a Blueprint variable?
- What error code did
Is Error Okreport?
Error codes and where to look for each one are listed in Data Types and Production Settings. For goal-specific patterns, continue with the Use Case Guides.
