Listen server vs dedicated server: why multiplayer in the cloud needs a dedicated server

You open your multiplayer Unreal app twice - you press "Host a session", a colleague presses "Join a session" - and sometimes it works, sometimes Join finds nothing. That is not a bug in your app. It is the difference between a listen server, which only works when both people end up on the same network, and a dedicated server, which works wherever each person is. This page explains both in plain words, with pictures, and shows the way that always works on Eagle 3D Streaming.

In 30 seconds

1. Listen server: one player's own copy of the app is also the server. The others must reach that copy - usually found by "LAN discovery", which only searches the local network.

2. On Eagle 3D Streaming every viewer gets their own session on their own machine, and our machines are spread over data centres on different continents. Two viewers are almost never on the same local network, so LAN discovery finds nothing.

3. It may work by chance: every session runs on its own machine. If the two machines happen to be in the same network (the same data centre), LAN discovery finds the host and Join works. Next time the sessions can be in different networks, and Join finds nothing. That is why the first test can work and later ones not.

4. Dedicated server: a separate server build that every player connects to. Eagle 3D Streaming hosts it for you, starts it when needed and joins every viewer to it automatically - guaranteed, and free for non-commercial use. How

How a listen server works

"Host a session" / "Join a session"

In many Unreal templates (Collab Viewer, the multiplayer samples) one person presses Host a session. Their copy of the app becomes the server and keeps playing as a normal player at the same time - it "listens" for others. The others press Join a session: the app searches for hosts on the local network (LAN discovery), or connects to the host's address (for example 127.0.0.1 on the same computer, or an IP address on port 7777).

On your own desk this works well: both computers are in the same office network, they can see each other, and LAN discovery finds the host in a second.

One office / one local network Your computer app + listen server "Host a session" Colleague's computer app "Join a session" LAN discovery finds it
A listen server works when everyone is on the same local network.

Why it is not guaranteed in the cloud

Different machines, different networks

When you stream the app, it does not run on your computer - it runs on one of our GPU machines, and so does your colleague's. Every person who opens a stream link gets their own session on their own machine, picked from data centres in different regions and continents. You may be streamed from the United States while your colleague is streamed from West Europe.

  • LAN discovery only searches the local network of the machine the app runs on. The other person's session is on a different machine, usually in a different data centre - it is not on that network, so Join finds nothing.
  • Sometimes it works: the two sessions always run on two different machines. When those machines happen to be in the same network (the same data centre), LAN discovery finds the host and the colleague joins. Which machines are used depends on which ones are free at that moment, so the same test can work once and fail the next time, when the sessions land in different networks.
  • Joining by IP address: our machines accept incoming connections, so a typed IP works when the other machine can be reached - but you do not know in advance which machine (or network) a session will get, so nobody can tell the players which address to type.
Data centre: United States Machine A your session: listen server "Host a session" Data centre: West Europe Machine B colleague's session "Join a session" - finds nothing different networks: LAN discovery cannot see the host
Each viewer's session runs on its own machine, often in another data centre. A listen server is only found when both machines happen to be in the same network.

The way that always works: a dedicated server

Free hosting on Eagle 3D Streaming

A dedicated server is a second build of your project that only runs the shared world - no graphics, no player of its own. Every player connects to it, wherever their session runs. (In Unreal, "dedicated server" means this server build - not a machine reserved for you.)

On Eagle 3D Streaming you upload the server build next to your app. We host it, start it when someone opens the app, and every viewer joins it automatically - no address to type, and it works from a phone browser too. Hosting the dedicated server is free for non-commercial use; the viewers' sessions are counted like any other streaming session.

Dedicated server hosted and started by Eagle 3D Streaming Your session machine A, United States Colleague's session machine B, West Europe both join automatically
Every session connects to the same hosted server - it does not matter where each session runs.
Listen server ("Host" / "Join")Dedicated server on Eagle 3D Streaming
Who is the serverOne player's own sessionA separate server build we host
How others find itLAN discovery / typed IPAutomatically, every viewer
Works when viewers are in different networks / continentsNo (only when both happen to be in the same network)Yes, guaranteed
Host leavesSession ends for everyoneThe world keeps running
Cost of the server-Free for non-commercial use
What you buildOne buildTwo builds: app + server (needs Unreal built from source)

Step by step:

One thing to know up front: Unreal can only package a dedicated server with an engine built from source (not the version installed from the Epic Games Launcher). The guide covers it.

Questions

Short answers

My first test worked - why not the next ones? In the first test the two sessions ran on two machines in the same network, so LAN discovery found the host. Later the sessions were in different networks.

Can you make sure both sessions run in the same network? No - every viewer gets their own machine, whichever one is free at that moment, so we cannot promise two sessions land in the same network. Use a dedicated server instead.

Can the second person join by the host machine's IP address? Our machines accept incoming connections, so it can work when the host's machine is reachable - but the host's machine (and its address) changes every session, so it is not a way to run a real event. A dedicated server has one fixed place every player joins.

Do I need to change my app? Yes, a little: package a dedicated server build from the same project and upload it next to the app. The multiplayer guide shows each step.

Need help?

We can look at your project with you

Write to support@eagle3dstreaming.com or ask in our Discord - we can go through your project setup with you before you package the server build.

Related

Last updated