internal void release() { _kcp.State = -1; _kcp.release(); IByteBuffer buffer; while (_writeQueue.TryDequeue(out buffer)) { buffer.Release(); } while (_readQueue.TryDequeue(out buffer)) { buffer.Release(); } _fecEncode?.release(); _fecDecode?.release(); }
public void release() { kcp.State = -1; kcp.release(); IByteBuffer buffer = null; while (_writeQueue.TryDequeue(out buffer)) { buffer.Release(); } while (_readQueue.TryDequeue(out buffer)) { buffer.Release(); } Console.WriteLine("关闭"); _fecEncode?.release(); _fecDecode?.release(); }
protected override bool TryDequeue(out ITask task) { return(_queue.TryDequeue(out task)); }