Skip to main content

KcpServerConnection

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

Server: the ITransportConnection for one client's KCP connection, wrapping a kcp2k server connection by id.

Constructors​

MemberWhat it is
KcpServerConnection(KcpTransport transport, KcpServer server, int connectionId)Creates a KcpServerConnection from transport, server and connectionId.

Fields​

3 private and internal fields
MemberWhat it is
private readonly KcpServerConnection internalConnectionThe kcp2k server connection, looked up by id when created.
private readonly KcpServer serverThe kcp2k server.
private readonly KcpTransport transportThe KcpTransport, used to map game channels to KCP channels.

Properties​

MemberWhat it is
int Id { get; }The kcp2k connection id.
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 this connection's KCP send queue.

Events​

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

Methods​

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

Used in​

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