Class ENetDriver
Low-level network transport interface implementation based on ENet library.
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/Networking/Drivers/ENetDriver.h
Syntax
public class ENetDriver : public ScriptingObject, public INetworkDriver
Methods
Connect()
Starts connection handshake with the end point specified in the NetworkConfig
Declaration
public virtual bool Connect() override
Returns
bool
True when succeeded. |
Overrides
Disconnect()
Disconnects from the server.
Can be used only by the client!
Declaration
public virtual void Disconnect() override
Overrides
Disconnect(const NetworkConnection& connection)
Disconnects given connection from the server.
Can be used only by the server!
Declaration
public virtual void Disconnect(const NetworkConnection& connection) override
Parameters
NetworkConnection
connection
|
Overrides
Dispose()
Disposes this driver making it no longer usable. Reserved for resource deallocation etc.
Declaration
public virtual void Dispose() override
Overrides
DriverName()
Return name of this network driver implementation.
Declaration
public virtual String DriverName() override
Returns
String
|
Overrides
GetStats()
Gets the network transport layer stats.
Declaration
public virtual NetworkDriverStats GetStats() override
Returns
NetworkDriverStats
Network transport statistics data for a given connection. |
Overrides
GetStats(NetworkConnection target)
Gets the network transport layer stats for a given connection.
Declaration
public virtual NetworkDriverStats GetStats(NetworkConnection target) override
Parameters
NetworkConnection
target
The client connection to retrieve statistics for. |
Returns
NetworkDriverStats
Network transport statistics data for a given connection. |
Overrides
Initialize(NetworkPeer* host, const NetworkConfig& config)
Initializes the instance of this network driver using given configuration.
Declaration
public virtual bool Initialize(NetworkPeer* host, const NetworkConfig& config) override
Parameters
NetworkPeer
host
The peer that this driver has been assigned to. |
NetworkConfig
config
The network config to use to configure this driver. |
Returns
bool
True if failed to initialize network driver, false otherwise. |
Overrides
Listen()
Starts listening for incoming connections. Once this is called, this driver becomes a server.
Declaration
public virtual bool Listen() override
Returns
bool
True when succeeded. |
Overrides
PopEvent(NetworkEvent& eventPtr)
Tries to pop an network event from the queue.
Declaration
public virtual bool PopEvent(NetworkEvent& eventPtr) override
Parameters
NetworkEvent
eventPtr
The pointer to event structure. |
Returns
bool
True when succeeded and the event can be processed. |
Overrides
SendMessage(NetworkChannelType channelType, const NetworkMessage& message)
Sends given message over specified channel to the server.
Can be used only by the client!
Declaration
public virtual void SendMessage(NetworkChannelType channelType, const NetworkMessage& message) override
Parameters
NetworkChannelType
channelType
The channel to send the message over. |
NetworkMessage
message
The message. |
Overrides
SendMessage(NetworkChannelType channelType, const NetworkMessage& message, const Array<NetworkConnection, HeapAllocation>& targets)
Sends given message over specified channel to the given client connection (target).
Can be used only by the server!
Declaration
public virtual void SendMessage(NetworkChannelType channelType, const NetworkMessage& message, const Array<NetworkConnection, HeapAllocation>& targets) override
Parameters
NetworkChannelType
channelType
The channel to send the message over. |
NetworkMessage
message
The message. |
Array<NetworkConnection, HeapAllocation>
targets
The connections list to send the message to. |
Overrides
SendMessage(NetworkChannelType channelType, const NetworkMessage& message, NetworkConnection target)
Sends given message over specified channel to the given client connection (target).
Can be used only by the server!
Declaration
public virtual void SendMessage(NetworkChannelType channelType, const NetworkMessage& message, NetworkConnection target) override
Parameters
NetworkChannelType
channelType
The channel to send the message over. |
NetworkMessage
message
The message. |
NetworkConnection
target
The client connection to send the message to. |