Skip to content

kcp2k::KcpConnection

Inherited by KcpClientConnection, KcpServerConnection

Public Functions

Name
void Tick()
void RawInput(byte [] buffer, int msgLength)
void Send(ArraySegment< byte > data)
void SendHandshake()
void Disconnect()
EndPoint GetRemoteEndPoint()

Protected Functions

Name
void SetupKcp(bool noDelay, uint interval =Kcp.INTERVAL, int fastResend =0, bool congestionWindow =true, uint sendWindowSize =Kcp.WND_SND, uint receiveWindowSize =Kcp.WND_RCV)
virtual abstract void RawSend(byte [] data, int length) =0
virtual void Dispose()

Public Attributes

Name
Action OnAuthenticated
Action< ArraySegment< byte > > OnData
Action OnDisconnected
const int TIMEOUT
const int PING_INTERVAL
int SendQueueCount
int ReceiveQueueCount
int SendBufferCount
int ReceiveBufferCount

Protected Attributes

Name
Socket socket
EndPoint remoteEndpoint

Public Functions Documentation

function Tick

inline void Tick()

function RawInput

inline void RawInput(
    byte [] buffer,
    int msgLength
)

function Send

inline void Send(
    ArraySegment< byte > data
)

function SendHandshake

inline void SendHandshake()

function Disconnect

inline void Disconnect()

function GetRemoteEndPoint

EndPoint GetRemoteEndPoint()

Protected Functions Documentation

function SetupKcp

inline void SetupKcp(
    bool noDelay,
    uint interval =Kcp.INTERVAL,
    int fastResend =0,
    bool congestionWindow =true,
    uint sendWindowSize =Kcp.WND_SND,
    uint receiveWindowSize =Kcp.WND_RCV
)

function RawSend

virtual abstract void RawSend(
    byte [] data,
    int length
) =0

Reimplemented by: kcp2k::KcpServerConnection::RawSend, kcp2k::KcpClientConnection::RawSend

function Dispose

inline virtual void Dispose()

Reimplemented by: kcp2k::KcpClientConnection::Dispose

Public Attributes Documentation

variable OnAuthenticated

Action OnAuthenticated;

variable OnData

Action< ArraySegment< byte > > OnData;

variable OnDisconnected

Action OnDisconnected;

variable TIMEOUT

const int TIMEOUT = 10000;

variable PING_INTERVAL

const int PING_INTERVAL = 1000;

variable SendQueueCount

int SendQueueCount => kcp.snd_queue.Count;

variable ReceiveQueueCount

int ReceiveQueueCount => kcp.rcv_queue.Count;

variable SendBufferCount

int SendBufferCount => kcp.snd_buf.Count;

variable ReceiveBufferCount

int ReceiveBufferCount => kcp.rcv_buf.Count;

Protected Attributes Documentation

variable socket

Socket socket;

variable remoteEndpoint

EndPoint remoteEndpoint;

Updated on 27 January 2021 at 19:35:33 UTC