private void Update() { lock (lockResponseInputQ) { while (responseInputQ.Count > 0) { if (responseInputQ.First.Value != null) { SocketResponse?.Invoke(responseInputQ.First.Value); responseInputQ.RemoveFirst(); } } } }
void QueueResponse(SocketResponse response) { lock (lockResponseInputQ) responseInputQ.AddLast(response); }