OmniQUIC Quick Start

Build a local QUIC round trip with a server Actor and a client Actor, using Blueprint only.

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
A Blueprint that runs a QUIC server and client and echoes a string over a stream

1. Prepare the project

  1. Create a Level and save it as a test Level.
  2. Check that UDP port 7777 is free.
  3. In the Content Browser, create two Actors from Blueprint Class and name them BP_QUICServer and BP_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.

  1. Add Create Server and store the return value in a variable named Server, of type OmniQUICServer.
  2. Check that the return value is valid with Is Valid, and stop if it is empty.
  3. Add Make Development Server Certificate.
  4. Create an OmniQUICServerSettings with Make Struct and set these values.
Field Value
Alpn omniquic
Idle Timeout Ms 10000
Max Connections 0 (no limit)
Port 7777
Certificate The value from step 3
  1. Pass the settings to Configure and check the result with Is Error Ok.
  2. Call Start and check the result with Is Error Ok. On success the server listens on all IPv4 interfaces.
  3. Check Is Listening. Get Listen Port reports 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.

  1. Place Bind Event after Event BeginPlay, and set its target to the client connection, not to the server. Store the Connection output of On Client Connected and bind its On Stream Started By Peer.
  2. Name the bound custom event HandlePeerStream. Store its Stream argument in a variable named EchoStream.
  3. Bind EchoStream’s On Data Received, and pass the received Data straight into EchoStream’s Send.

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.

  1. Add Create Client and store the return value in a variable named Client, of type OmniQUICClient.
  2. Check that the return value is valid with Is Valid.
  3. Create an OmniQUICClientSettings with Make Struct and set these values.
Field Value
Alpn omniquic
Validation Policy AcceptAnyCertificate
Idle Timeout Ms 3000
  1. Pass the settings to Configure and check the result with Is Error Ok.
  2. Bind Client’s On Connected, On Disconnected and On Stream Started By Peer to 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.

  1. Add Connect after the Delay.
  2. Set Host to 127.0.0.1 and Port to 7777.
  3. Check the returned error with Is Error Ok. A successful return means the attempt was accepted, not that the connection is up.
  4. The connection is up when On Connected fires. Log the Reason in On 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.

  1. In the On Connected custom event, call Open Bidirectional Stream.
  2. The return value is FOmniQUICStreamOpenResult. Store Stream in a variable named Stream, and test Error with Is Error Ok.
  3. Bind Stream’s On Data Received.
  4. Pass hello stream to String To Bytes and connect it to Send. Leave Finish Send false.

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

  1. On the client, call Close on the stream. It starts a graceful close, and On Closed reports completion.
  2. Call Disconnect on Client. On Disconnected reports completion.
  3. Call Shutdown last. It waits until every handle is closed, so run it where nothing else needs to happen, such as when the Level ends.
  4. On the server, call Stop to close the listener, then Shutdown to 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

  1. Download OmniQUICEchoServer_1.0.0_windows-amd64.zip from the download page.
  2. Unpack the zip. Keep OmniQUICEchoServer.exe in the same folder as the three DLLs (vcruntime140.dll, vcruntime140_1.dll, msvcp140.dll); the app does not start without them.
  3. Double-click OmniQUICEchoServer.exe. If SmartScreen warns about a freshly downloaded program, choose More info and Run anyway. The executable is signed.
  4. Choose the listen address. Use 127.0.0.1 (this PC only) to connect from Unreal Engine on the same PC, or 0.0.0.0 (all interfaces) to connect from another PC.
  5. Set Port. The default is 4433.
  6. Press Start. The status line changes to Running on <address>:<port> when the server is listening.
The OmniQUIC Echo Server window before Start is pressed: 127.0.0.1 (this PC only) selected, Port 4433, Status Stopped, and the auto-generated self-signed certificate selected.

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 Connect fails with ConnectionLimitReached.

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

  1. Is another process using UDP port 7777, or 4433 when you connect to the Echo Server?
  2. Is OmniQUIC enabled for this project in Edit → Plugins?
  3. Does the client connect only after the server’s Start?
  4. Do the client and the server use the same Alpn?
  5. Is every created object stored in a Blueprint variable?
  6. What error code did Is Error Ok report?

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.