private void ProcessShortHeaderPacket(Packet packet) { ShortHeaderPacket shp = (ShortHeaderPacket)packet; QuicConnection connection = ConnectionPool.Find(shp.DestinationConnectionId); if (connection == null) { return; // TODO: Figure out if the packet should be discarded in that case? } connection.ProcessFrames(shp.GetFrames()); }
/// <summary> /// Processes short header packet, by distributing the frames towards connections. /// </summary> /// <param name="packet"></param> private void ProcessShortHeaderPacket(Packet packet) { ShortHeaderPacket shp = (ShortHeaderPacket)packet; QuicConnection connection = ConnectionPool.Find(shp.DestinationConnectionId); // No suitable connection found. Discard the packet. if (connection == null) { return; } connection.ProcessFrames(shp.GetFrames()); }
/// <summary> /// Client only! /// </summary> /// <returns></returns> internal void ReceivePacket() { Packet packet = _pwt.ReadPacket(); if (packet is ShortHeaderPacket) { ShortHeaderPacket shp = (ShortHeaderPacket)packet; ProcessFrames(shp.GetFrames()); } // If the connection has been closed if (_state == ConnectionState.Draining) { if (string.IsNullOrWhiteSpace(_lastError)) { _lastError = "Protocol error"; } TerminateConnection(); throw new QuicConnectivityException(_lastError); } }