Esempio n. 1
0
        internal void AddEvent(QuicEvent evt, QuicState state)
        {
            switch (evt.EventId)
            {
            case QuicEventId.DatapathSend:
            {
                state.DataAvailableFlags |= QuicDataAvailableFlags.Datapath;
                var _evt = evt as QuicDatapathSendEvent;
                BytesSent += _evt !.TotalSize;
                SendEventCount++;

                var worker = state.GetWorkerFromThread(evt.ProcessId, evt.ThreadId);
                if (worker != null && worker.LastConnection != null)
                {
                    worker.LastConnection.AddEvent(evt, state);
                }
                break;
            }

            case QuicEventId.DatapathRecv:
            {
                state.DataAvailableFlags |= QuicDataAvailableFlags.Datapath;
                var _evt = evt as QuicDatapathRecvEvent;
                BytesReceived += _evt !.TotalSize;
                ReceiveEventCount++;
                break;
            }

            default:
                break;
            }

            Events.Add(evt);
        }
Esempio n. 2
0
 private void TrySetWorker(QuicEvent evt, QuicState state)
 {
     if (Worker == null)
     {
         Worker = state.GetWorkerFromThread(evt.ProcessId, evt.ThreadId);
         Worker?.OnConnectionAdded();
     }
 }