private void SendThread() { while (IsConnected) { try { if (mKCP != null) { uint time = Current; if (time >= mNextUpdateTime) { mKCP.Update(time); mNextUpdateTime = mKCP.Check(time); } } } catch (Exception e) { Close(); throw e; } Thread.Sleep(1); } }
private void UpdateKcp() { if (mKCP != null) { uint time = current; if (time >= mNextUpdateTime) { mKCP.Update(time); mNextUpdateTime = mKCP.Check(time); } } }
public void Update(UInt32 current) { ProcessRecv(current); var err = GetError(); if (err != null) { throw err; } if (needUpdate || current > nextUpdateTime) { kcp.Update(current); nextUpdateTime = kcp.Check(current); needUpdate = false; } CheckTimeout(current); }
public void UpdateKcp() { if (mKCP == null) { return; } if (mService == null || mService.kcp == null || mService.kcp.IsActive == false) { return; } uint time = current; if (time >= mNextUpdateTime) { mKCP.Update(time); mNextUpdateTime = mKCP.Check(time); } }