21 explicit ENetHostWrapper(
size_t maxConnections = 1,
size_t maxChannels = 2,
22 uint32_t incomingBandwidth = 0, uint32_t outgoingBandwidth = 0);
26 uint32_t incomingBandwidth = 0, uint32_t outgoingBandwidth = 0);
34 std::optional<HostNetworkEvent>
service(uint32_t timeout)
override;
35 void broadcast(std::unique_ptr<IPacket> packet, uint8_t channelID)
override;
36 void flush()
override;
43 std::map<ENetPeer *, std::unique_ptr<ENetPeerWrapper>>
_peers;
std::map< ENetPeer *, std::unique_ptr< ENetPeerWrapper > > _peers
void broadcast(std::unique_ptr< IPacket > packet, uint8_t channelID) override
Broadcast a packet to all connected peers.
IPeer * connect(const IAddress &address, size_t channelCount, uint32_t data) override
Connect to a remote host.
std::optional< HostNetworkEvent > service(uint32_t timeout) override
Service the host, processing network events.
const IAddress & getAddress() const override
Get the address this host is bound to.
ENetHostWrapper & operator=(const ENetHostWrapper &)=delete
~ENetHostWrapper() override
std::unique_ptr< ENetAddressWrapper > _cachedAddress
ENetHostWrapper(const ENetHostWrapper &)=delete
void flush() override
Send all queued packets immediately.
size_t getPeerCount() const override
Get the number of connected peers.
Interface representing a network address (IP + port).
Interface representing a network host (server or client endpoint).
Interface representing a remote peer in the network.