public void StartKcp(int vFd, int vToken, System.Object vKcpRecvCall) { mFd = (UInt32)vFd; mToken = (UInt32)vToken; kcpRecvCall = vKcpRecvCall; lock (mKcpLock) { mUnpackTool.Clear(); // create kcp mKcp = new KCP(mToken, (byte[] buf, int size) => { LittleEndian.encode32u(sendBuffer, 0, mFd); Array.Copy(buf, 0, sendBuffer, 4, size); UdpSend(sendBuffer, size + 4); }); // default setting mKcp.NoDelay(1, KCP_UPDATE_INTERVAL, 2, 1); //mKcp.SetMinrto(80); } }
public void KcpNoDelay(int nodelay, int interval, int resend, int nc) { mKcp.NoDelay(nodelay, interval, resend, nc); }