Search Results for

    Show / Hide Table of Contents

    Class NetworkLagDriver

    Low-level network transport interface implementation that is proxy of another nested INetworkDriver implementation but with lag simulation feature.

    Inheritance
    System.Object
    Object
    NetworkLagDriver
    Implements
    INetworkDriver
    Inherited Members
    Object.__unmanagedPtr
    Object.__internalId
    Object.Finalize()
    Object.As<T>()
    Object.NewValue(Type)
    Object.New(String)
    Object.Find<T>(Guid, Boolean)
    Object.Find(Guid, Type, Boolean)
    Object.TryFind<T>(Guid)
    Object.TryFind(Guid, Type)
    Object.Destroy(Object, Single)
    Object.DestroyNow(Object)
    Object.Destroy<T>(T, Single)
    Object.Equals(Object)
    Object.GetUnmanagedPtr(Object)
    Object.GetUnmanagedInterface(Object, Type)
    Object.FromUnmanagedPtr(IntPtr)
    Object.MapObjectID(Guid)
    Object.RemapObjectID(Guid)
    Object.GetHashCode()
    Object.ID
    Object.TypeName
    Namespace: FlaxEngine.Networking
    Assembly: FlaxEngine.CSharp.dll
    Syntax
    [Unmanaged]
    public sealed class NetworkLagDriver : Object, INetworkDriver

    Constructors

    NetworkLagDriver()

    Initializes a new instance of the NetworkLagDriver.

    Declaration
    public NetworkLagDriver()

    Properties

    Driver

    Gets or sets or sets the nested INetworkDriver to use as a proxy with lags.

    Declaration
    [Unmanaged]
    public INetworkDriver Driver { get; set; }
    Property Value
    INetworkDriver

    Lag

    Network lag value in milliseconds. Adds a delay between sending and receiving messages (2 * Lag is TTL).

    Declaration
    [Unmanaged]
    public float Lag { get; set; }
    Property Value
    System.Single

    Methods

    Connect()

    Starts connection handshake with the end point specified in the NetworkConfig structure. Once this is called, this driver becomes a client.

    Declaration
    [Unmanaged]
    public bool Connect()
    Returns
    System.Boolean

    True when succeeded.

    Implements
    INetworkDriver.Connect()

    Disconnect()

    Disconnects from the server.

    Declaration
    [Unmanaged]
    public void Disconnect()
    Implements
    INetworkDriver.Disconnect()
    Remarks

    Can be used only by the client!

    Disconnect(NetworkConnection)

    Disconnects given connection from the server.

    Declaration
    [Unmanaged]
    public void Disconnect(NetworkConnection connection)
    Parameters
    NetworkConnection connection

    Implements
    INetworkDriver.Disconnect(NetworkConnection)
    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
    INetworkDriver.Dispose()

    DriverName()

    Return name of this network driver implementation.

    Declaration
    [Unmanaged]
    public string DriverName()
    Returns
    System.String

    Implements
    INetworkDriver.DriverName()

    GetStats()

    Gets the network transport layer stats.

    Declaration
    [Unmanaged]
    public NetworkDriverStats GetStats()
    Returns
    NetworkDriverStats

    Network transport statistics data for a given connection.

    Implements
    INetworkDriver.GetStats()

    GetStats(NetworkConnection)

    Gets the network transport layer stats for a given connection.

    Declaration
    [Unmanaged]
    public NetworkDriverStats GetStats(NetworkConnection target)
    Parameters
    NetworkConnection target

    The client connection to retrieve statistics for.

    Returns
    NetworkDriverStats

    Network transport statistics data for a given connection.

    Implements
    INetworkDriver.GetStats(NetworkConnection)

    Initialize(NetworkPeer, NetworkConfig)

    Initializes the instance of this network driver using given configuration.

    Declaration
    [Unmanaged]
    public bool Initialize(NetworkPeer host, NetworkConfig config)
    Parameters
    NetworkPeer host

    The peer that this driver has been assigned to.

    NetworkConfig config

    The network config to use to configure this driver.

    Returns
    System.Boolean

    True if failed to initialize network driver, false otherwise.

    Implements
    INetworkDriver.Initialize(NetworkPeer, NetworkConfig)

    Listen()

    Starts listening for incoming connections. Once this is called, this driver becomes a server.

    Declaration
    [Unmanaged]
    public bool Listen()
    Returns
    System.Boolean

    True when succeeded.

    Implements
    INetworkDriver.Listen()

    PopEvent(out NetworkEvent)

    Tries to pop an network event from the queue.

    Declaration
    [Unmanaged]
    public bool PopEvent(out NetworkEvent eventPtr)
    Parameters
    NetworkEvent eventPtr

    The pointer to event structure.

    Returns
    System.Boolean

    True when succeeded and the event can be processed.

    Implements
    INetworkDriver.PopEvent(out NetworkEvent)

    SendMessage(NetworkChannelType, NetworkMessage)

    Sends given message over specified channel to the server.

    Declaration
    [Unmanaged]
    public void SendMessage(NetworkChannelType channelType, NetworkMessage message)
    Parameters
    NetworkChannelType channelType

    The channel to send the message over.

    NetworkMessage message

    The message.

    Implements
    INetworkDriver.SendMessage(NetworkChannelType, NetworkMessage)
    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
    NetworkChannelType channelType

    The channel to send the message over.

    NetworkMessage message

    The message.

    NetworkConnection target

    The client connection to send the message to.

    Implements
    INetworkDriver.SendMessage(NetworkChannelType, NetworkMessage, NetworkConnection)
    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
    NetworkChannelType channelType

    The channel to send the message over.

    NetworkMessage message

    The message.

    NetworkConnection[] targets

    The connections list to send the message to.

    Implements
    INetworkDriver.SendMessage(NetworkChannelType, NetworkMessage, NetworkConnection[])
    Remarks

    Can be used only by the server!

    Extension Methods

    Extensions.ReflectiveCompare<T>(T, T)
    Extensions.DeepClone<T>(T)
    Extensions.RawClone<T>(T)
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat