Search Results for

    Show / Hide Table of Contents

    Class NetworkChannel

    Represents a channel in the network which has a registry of packets it recognises.

    Inheritance
    Object
    NetworkChannel
    Namespace: FNNLib.Messaging
    Assembly: FNNLib.dll
    Syntax
    [Serializable]
    public sealed class NetworkChannel

    Constructors

    | Improve this Doc View Source

    NetworkChannel(ChannelType)

    Create a new network channel.

    Declaration
    public NetworkChannel(ChannelType type)
    Parameters
    Type Name Description
    ChannelType type

    Network channel type.

    Fields

    | Improve this Doc View Source

    channelType

    The channel type. Used for URDP transports.

    Declaration
    public ChannelType channelType
    Field Value
    Type Description
    ChannelType
    | Improve this Doc View Source

    Reliable

    Default reliable channel.

    Declaration
    public static readonly NetworkChannel Reliable
    Field Value
    Type Description
    NetworkChannel
    | Improve this Doc View Source

    ReliableSequenced

    Default reliable sequenced channel.

    Declaration
    public static readonly NetworkChannel ReliableSequenced
    Field Value
    Type Description
    NetworkChannel
    | Improve this Doc View Source

    Unreliable

    Default unreliable channel.

    Declaration
    public static readonly NetworkChannel Unreliable
    Field Value
    Type Description
    NetworkChannel

    Properties

    | Improve this Doc View Source

    ID

    Get the channel ID. Mostly for internal use.

    Declaration
    public int ID { get; }
    Property Value
    Type Description
    Int32

    Methods

    | Improve this Doc View Source

    ClientSend(Int32, NetworkWriter)

    Send a generic message to the server.

    Declaration
    public void ClientSend(int messageId, NetworkWriter packetWriter)
    Parameters
    Type Name Description
    Int32 messageId
    NetworkWriter packetWriter
    | Improve this Doc View Source

    ClientSend<T>(T)

    Send a typed message to the server.

    Declaration
    public void ClientSend<T>(T packet)
        where T : ISerializable
    Parameters
    Type Name Description
    T packet

    The message to send.

    Type Parameters
    Name Description
    T

    The type of the message.

    Exceptions
    Type Condition
    Exception

    The type was not found in the registry.

    | Improve this Doc View Source

    GetFactory()

    Get a factory for the next message ID.

    Declaration
    public NetworkChannel.MessageFactory GetFactory()
    Returns
    Type Description
    NetworkChannel.MessageFactory
    | Improve this Doc View Source

    GetFactory(Int32)

    Get a factory for the current ID.

    Declaration
    public NetworkChannel.MessageFactory GetFactory(int id)
    Parameters
    Type Name Description
    Int32 id
    Returns
    Type Description
    NetworkChannel.MessageFactory
    | Improve this Doc View Source

    GetNextID()

    Get the next available ID from the internal counter.

    Declaration
    public int GetNextID()
    Returns
    Type Description
    Int32

    The next available ID

    | Improve this Doc View Source

    HandleBuffered(BufferedPacket, Boolean)

    Handle a buffered packet.

    Declaration
    public void HandleBuffered(BufferedPacket packet, bool server)
    Parameters
    Type Name Description
    BufferedPacket packet

    The buffered packet

    Boolean server

    Whether or not this is handled on serverside.

    | Improve this Doc View Source

    HandleIncoming(UInt64, NetworkReader, Boolean)

    Handle an incoming packet.

    Declaration
    public void HandleIncoming(ulong clientID, NetworkReader reader, bool server)
    Parameters
    Type Name Description
    UInt64 clientID
    NetworkReader reader
    Boolean server
    | Improve this Doc View Source

    ResetChannel()

    Fully reset channel, clearing registries.

    Declaration
    public void ResetChannel()
    | Improve this Doc View Source

    ServerSend(List<UInt64>, Int32, NetworkWriter)

    Send a generic message to a list of clients.

    Declaration
    public void ServerSend(List<ulong> clientIds, int messageId, NetworkWriter packetWriter)
    Parameters
    Type Name Description
    List<UInt64> clientIds

    The clients to send to.

    Int32 messageId

    The message ID.

    NetworkWriter packetWriter

    Writer containing message information.

    Exceptions
    Type Condition
    Exception
    | Improve this Doc View Source

    ServerSend(List<UInt64>, Int32, NetworkWriter, UInt64)

    Send a generic message to a list of clients, excluding one.

    Declaration
    public void ServerSend(List<ulong> clientIds, int messageId, NetworkWriter packetWriter, ulong excludedClient)
    Parameters
    Type Name Description
    List<UInt64> clientIds

    The clients to send to.

    Int32 messageId

    The message ID.

    NetworkWriter packetWriter

    Writer containing message information.

    UInt64 excludedClient

    The client to exclude.

    Exceptions
    Type Condition
    Exception
    | Improve this Doc View Source

    ServerSend(Int32, NetworkWriter)

    Send a generic message to all clients.

    Declaration
    public void ServerSend(int messageId, NetworkWriter packetWriter)
    Parameters
    Type Name Description
    Int32 messageId

    The message ID.

    NetworkWriter packetWriter

    Writer containing message information

    | Improve this Doc View Source

    ServerSend(Int32, NetworkWriter, UInt64)

    Send a generic message to all clients excluding one.

    Declaration
    public void ServerSend(int messageId, NetworkWriter packetWriter, ulong excludedClient)
    Parameters
    Type Name Description
    Int32 messageId

    The message ID.

    NetworkWriter packetWriter

    Writer containing message information

    UInt64 excludedClient

    Client to exclude.

    | Improve this Doc View Source

    ServerSend(UInt64, Int32, NetworkWriter)

    Send a generic message to a client.

    Declaration
    public void ServerSend(ulong clientId, int messageId, NetworkWriter packetWriter)
    Parameters
    Type Name Description
    UInt64 clientId

    The client to send to.

    Int32 messageId

    The message ID.

    NetworkWriter packetWriter

    Writer containing message information.

    Exceptions
    Type Condition
    Exception
    | Improve this Doc View Source

    ServerSend<T>(T)

    Send a typed message to all clients.

    Declaration
    public void ServerSend<T>(T packet)
        where T : ISerializable
    Parameters
    Type Name Description
    T packet

    The message to send.

    Type Parameters
    Name Description
    T

    The type of the message

    | Improve this Doc View Source

    ServerSend<T>(T, UInt64)

    Send a typed message to all clients excluding one.

    Declaration
    public void ServerSend<T>(T packet, ulong excludedClient)
        where T : ISerializable
    Parameters
    Type Name Description
    T packet

    The message to send.

    UInt64 excludedClient

    Client to exclude

    Type Parameters
    Name Description
    T

    The type of the message

    | Improve this Doc View Source

    ServerSend<T>(List<UInt64>, T)

    Send a typed message to a list of clients.

    Declaration
    public void ServerSend<T>(List<ulong> clientIds, T packet)
        where T : ISerializable
    Parameters
    Type Name Description
    List<UInt64> clientIds

    The clients to send to.

    T packet

    The message to send.

    Type Parameters
    Name Description
    T

    The type of the message.

    Exceptions
    Type Condition
    Exception
    | Improve this Doc View Source

    ServerSend<T>(List<UInt64>, T, UInt64)

    Sends a typed message to a list of clients, excluding one.

    Declaration
    public void ServerSend<T>(List<ulong> clientIds, T packet, ulong excludedClient)
        where T : ISerializable
    Parameters
    Type Name Description
    List<UInt64> clientIds

    The clients to send to.

    T packet

    The message to send.

    UInt64 excludedClient

    The client to exclude.

    Type Parameters
    Name Description
    T

    The type of the message

    Exceptions
    Type Condition
    Exception
    | Improve this Doc View Source

    ServerSend<T>(UInt64, T)

    Send a typed message to a client.

    Declaration
    public void ServerSend<T>(ulong clientId, T packet)
        where T : ISerializable
    Parameters
    Type Name Description
    UInt64 clientId

    The client to send to.

    T packet

    The message to send.

    Type Parameters
    Name Description
    T

    The type of the message.

    Exceptions
    Type Condition
    Exception

    Message type not in the registry.

    • Improve this Doc
    • View Source
    In This Article
    Back to top (C) 2020 Reece Mackie. Released under the MIT License.