Skip to main content

KcpClientConnection

A class in Alta.NetworkTransport.Runtime, Alta.NetworkingTransport.Kcp.

Client: the ITransportConnection for the client's single KCP connection to the server.

Constructors​

MemberWhat it is
KcpClientConnection(KcpTransport transport, KcpClient client)Creates a KcpClientConnection from transport and client.

Fields​

2 private and internal fields
MemberWhat it is
private readonly KcpClient clientThe kcp2k client.
private readonly KcpTransport transportThe KcpTransport, used to map game channels to KCP channels.

Properties​

MemberWhat it is
int Id { get; }Always 0; the client has only one connection.
bool IsFlooded { get; }Always false for KCP.
int OutgoingBytesTotal { get; private set; }Total bytes sent through Send (empty sends not counted).
int OutgoingPacketsTotal { get; private set; }Total packets sent through Send (empty sends not counted).
int OutgoingQueueSize { get; }Number of messages in the KCP send queue.

Events​

MemberWhat it is
event Action<ITransportConnection> DisconnectedRaised by OnDisconnected when the connection drops.

Methods​

MemberWhat it is
INetworkTransportResult Disconnect()Disconnects the KCP client.
void OnDisconnected()Raises Disconnected; called by the transport.
INetworkTransportResult Send(byte[] data, int byteCount, int highLevelChannel)Sends the bytes on the KCP channel mapped from the game channel, writing the game channel into the first byte.

Used in​

Members of other types that take, return or hold a KcpClientConnection: