class

ENetTransport

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

Constructors

SignatureNameDescription
ENetTransport() = defaultENetTransport
~ENetTransport() override~ENetTransport

Public functions

ReturnsNameDescription
boolHost
uint16_tGetBoundPort
boolConnect
voidDisconnect
voidDisconnectPeer
voidDisconnectPeerAfterFlush
voidPoll
voidSend
voidBroadcast
ConnectionStateGetState
uint32_tGetLocalPeerId
const std::vector<NetworkPeer>&GetPeers
boolGetPeerStats
boolGetSimulationStats
voidSetEncryptionModeOverrides the net.encrypt / net.psk config for this transport instance.
voidSetPreSharedKey
ENetEncryptionModeGetEncryptionMode
std::stringGetJoinKeyHost: the key a peer from off this machine has to present — the one the host made up for this session when no net.psk is configured, empty otherwise.
voidSetJoinKey
boolIsPeerEncrypted
boolShouldWarnUnauthenticatedTrue when a session is encrypted but ANONYMOUS (empty PSK) on a public (non-private, non-loopback) address — the man-in-the-middle exposure the transport warns about.
std::stringHostPskForThe PSK a host demands from a peer at peerAddress, and the one a client presents to address: a configured net.psk for everyone; otherwise none on loopback and the host's join key from anywhere else.
std::stringClientPskFor
FNetSimQueue&GetSendSimulationNetwork emulation (net.sim.*).
FNetSimQueue&GetReceiveSimulation

Function details

ENetTransport

C++
ENetTransport() = default

~ENetTransport

C++
~ENetTransport() override

Host

C++
bool Host(uint16_t port, uint32_t maxClients) override

GetBoundPort

C++
uint16_t GetBoundPort() const override

Connect

C++
bool Connect(const std::string& address, uint16_t port) override

Disconnect

C++
void Disconnect() override

DisconnectPeer

C++
void DisconnectPeer(uint32_t peerId) override

DisconnectPeerAfterFlush

C++
void DisconnectPeerAfterFlush(uint32_t peerId) override

Poll

C++
void Poll(std::vector<NetworkEvent>& outEvents) override

Send

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

Broadcast

C++
void Broadcast(const void* data, size_t size, uint8_t channel) override

GetState

C++
ConnectionState GetState() const override

GetLocalPeerId

C++
uint32_t GetLocalPeerId() const override

GetPeers

C++
const std::vector<NetworkPeer>& GetPeers() const override

GetPeerStats

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

GetSimulationStats

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

SetEncryptionMode

C++
void SetEncryptionMode(ENetEncryptionMode mode)

Overrides the net.encrypt / net.psk config for this transport instance. Must be called before Host/Connect.

SetPreSharedKey

C++
void SetPreSharedKey(const std::string& psk)

GetEncryptionMode

C++
ENetEncryptionMode GetEncryptionMode() const

GetJoinKey

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

Host: the key a peer from off this machine has to present — the one the host made up for this session when no net.psk is configured, empty otherwise. Client: the key to present to the next host (host:port#KEY). Loopback links need none: nothing off this machine can sit between them.

SetJoinKey

C++
void SetJoinKey(const std::string& key) override

IsPeerEncrypted

C++
bool IsPeerEncrypted(uint32_t peerId) const

ShouldWarnUnauthenticated

C++
static bool ShouldWarnUnauthenticated(const std::string& address, bool encrypted, const std::string& psk)

True when a session is encrypted but ANONYMOUS (empty PSK) on a public (non-private, non-loopback) address — the man-in-the-middle exposure the transport warns about. Static + pure so it's unit-testable.

HostPskFor

C++
static std::string HostPskFor(const std::string& configuredPsk, const std::string& sessionKey, const std::string& peerAddress)

The PSK a host demands from a peer at peerAddress, and the one a client presents to address: a configured net.psk for everyone; otherwise none on loopback and the host's join key from anywhere else. Pure, for tests.

ClientPskFor

C++
static std::string ClientPskFor(const std::string& configuredPsk, const std::string& joinKey, const std::string& address)

GetSendSimulation

C++
FNetSimQueue& GetSendSimulation()

Network emulation (net.sim.*). Both queues follow the process-wide settings unless a caller pins its own — a test wants a fixed pattern, not whatever the console last set.

GetReceiveSimulation

C++
FNetSimQueue& GetReceiveSimulation()
Generated from Networking/ENetTransport.h via networking.json · Nov 4, 2026Version 1.0.0