class

INetworkTransport

Both ENet and Steam Networking Sockets implement this.

Module
Networking
Header
#include "Networking/INetworkTransport.h"
Namespace
Mowo

Constructors

SignatureNameDescription
virtual ~INetworkTransport() = default~INetworkTransport

Public functions

ReturnsNameDescription
boolHostHost a server on the given port (max clients for ENet, ignored for Steam P2P)
uint16_tGetBoundPortThe UDP port a host is actually listening on.
boolConnectConnect to a remote host (address:port for ENet, Steam ID string for Steam)
voidDisconnect
voidDisconnectPeerForcibly disconnect a single peer (server-side; e.g.
voidDisconnectPeerAfterFlushDisconnect a peer only after everything queued for it has been delivered — the cut that follows a notice (a kick reason, a join refusal).
voidPollPoll for network events (non-blocking).
voidSend
voidBroadcast
ConnectionStateGetState
uint32_tGetLocalPeerIdLocal peer ID (assigned by host)
const std::vector<NetworkPeer>&GetPeers
boolGetPeerStats
boolGetSimulationStatsnet.sim.* counters for a debug UI.
std::stringGetJoinKeyThe secret a direct (ENet) link authenticates with.
voidSetJoinKey

Function details

~INetworkTransport

C++
virtual ~INetworkTransport() = default

Host

C++
virtual bool Host(uint16_t port, uint32_t maxClients) = 0

Host a server on the given port (max clients for ENet, ignored for Steam P2P)

GetBoundPort

C++
virtual uint16_t GetBoundPort() const

The UDP port a host is actually listening on. Host(0, ...) asks the OS for a free one — the only choice that cannot collide with a Windows excluded port range — and this is how the caller learns which it got. 0 when not hosting or when the transport has no socket (Steam P2P).

Connect

C++
virtual bool Connect(const std::string& address, uint16_t port) = 0

Connect to a remote host (address:port for ENet, Steam ID string for Steam)

Disconnect

C++
virtual void Disconnect() = 0

DisconnectPeer

C++
virtual void DisconnectPeer(uint32_t peerId)

Forcibly disconnect a single peer (server-side; e.g. failed auth). Default no-op so transports that can't target a single peer still compile; ENet overrides it.

DisconnectPeerAfterFlush

C++
virtual void DisconnectPeerAfterFlush(uint32_t peerId)

Disconnect a peer only after everything queued for it has been delivered — the cut that follows a notice (a kick reason, a join refusal). An immediate reset on the heels of a send loses the notice: when the data and the disconnect land in one service pass the peer purges its undelivered receive queue before dispatching. Transports with no graceful form fall back to the immediate cut.

Poll

C++
virtual void Poll(std::vector<NetworkEvent>& outEvents) = 0

Poll for network events (non-blocking). Called once per frame.

Send

C++
virtual void Send(uint32_t peerId, const void* data, size_t size, uint8_t channel) = 0

Broadcast

C++
virtual void Broadcast(const void* data, size_t size, uint8_t channel) = 0

GetState

C++
virtual ConnectionState GetState() const = 0

GetLocalPeerId

C++
virtual uint32_t GetLocalPeerId() const = 0

Local peer ID (assigned by host)

GetPeers

C++
virtual const std::vector<NetworkPeer>& GetPeers() const = 0

GetPeerStats

C++
virtual bool GetPeerStats(uint32_t peerId, NetworkPeerStats& outStats) const

GetSimulationStats

C++
virtual bool GetSimulationStats(FNetSimTransportStats& outStats) const

net.sim.* counters for a debug UI. False when this transport doesn't run its own injector — Steam pushes its FakePacketLoss/FakePacketLag knobs to the platform SDK instead of an FNetSimQueue.

GetJoinKey

C++
virtual std::string GetJoinKey() const

The secret a direct (ENet) link authenticates with. A host reports the key it made up for the session; a client is handed the key to present before Connect. Transports that authenticate otherwise (Steam tickets) have none.

SetJoinKey

C++
virtual void SetJoinKey(const std::string& key)
Generated from Networking/INetworkTransport.h via networking.json · Nov 4, 2026Version 1.0.0