Skip to main content
The coop network carries your game’s own messages between the members of a lobby. Nobody opens a port. The Arcane desktop app connects the players directly when it can, and through Arcane’s relay when a direct path does not exist. Your game reads and writes local sockets and never sees an address.

Host and members

The network is a star around the lobby host. The host’s game reaches every member; a member’s game reaches the host only. A member’s Peer::All reaches the host alone. To relay a member’s message to the others, have the host send it on. There is no host migration: when the host leaves, the lobby and the network close.

Two channels

A larger message is refused with invalid_argument before it leaves your game.

Events

poll_events() reads memory only. Call it every frame. route is Direct or Relayed. A relayed link adds the relay’s round trip, so show it to the player when latency matters.

Refusing the relay

Some players do not want their traffic to go through a relay. Open with allow_relay: false:
A pair of players that cannot connect directly then gets RelayRefused instead of a link. Either side refusing is enough.

Receiving

receive() reads memory only. Drain it every frame. Past 64 MiB waiting, new unreliable messages are dropped, and a reliable one closes the network with the reason receive_overflow.
open() and close() make one loopback round trip to the Arcane desktop app. Call them when a match starts and ends, never per frame. send(), receive() and poll_events() never wait on the network.

Errors

Full table and what to do about each: Errors.

In C

Details: C ABI.

Next steps