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