Search Results for

    Show / Hide Table of Contents

    Interface INetworkDriver

    Basic interface for the low-level network transport/driver.

    Namespace: FlaxEngine.Networking
    Assembly: FlaxEngine.CSharp.dll
    Syntax
    [Unmanaged]
    public interface INetworkDriver

    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]
    bool Connect()
    Returns
    System.Boolean

    True when succeeded.

    Disconnect()

    Disconnects from the server.

    Declaration
    [Unmanaged]
    void Disconnect()
    Remarks

    Can be used only by the client!

    Disconnect(NetworkConnection)

    Disconnects given connection from the server.

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

    Remarks

    Can be used only by the server!

    Dispose()

    Disposes this driver making it no longer usable. Reserved for resource deallocation etc.

    Declaration
    [Unmanaged]
    void Dispose()

    DriverName()

    Return name of this network driver implementation.

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

    GetStats()

    Gets the network transport layer stats.

    Declaration
    [Unmanaged]
    NetworkDriverStats GetStats()
    Returns
    NetworkDriverStats

    Network transport statistics data for a given connection.

    GetStats(NetworkConnection)

    Gets the network transport layer stats for a given connection.

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

    The client connection to retrieve statistics for.

    Returns
    NetworkDriverStats

    Network transport statistics data for a given connection.

    Initialize(NetworkPeer, NetworkConfig)

    Initializes the instance of this network driver using given configuration.

    Declaration
    [Unmanaged]
    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.

    Listen()

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

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

    True when succeeded.

    PopEvent(out NetworkEvent)

    Tries to pop an network event from the queue.

    Declaration
    [Unmanaged]
    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.

    SendMessage(NetworkChannelType, NetworkMessage)

    Sends given message over specified channel to the server.

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

    The channel to send the message over.

    NetworkMessage message

    The message.

    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]
    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.

    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]
    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.

    Remarks

    Can be used only by the server!

    Extension Methods

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