/// <summary> /// Iterates over all active HTTP/2 streams. /// <para>This method must not be called outside of the event loop.</para> /// </summary> /// <param name="streamVisitor"></param> public void ForEachActiveStream(IHttp2FrameStreamVisitor streamVisitor) { Debug.Assert(_ctx.Executor.InEventLoop); var connection = Connection; if (connection.NumActiveStreams > 0) { _ = connection.ForEachActiveStream(stream => InternalVisit(stream, streamVisitor)); } }
private bool InternalVisit(IHttp2Stream stream, IHttp2FrameStreamVisitor streamVisitor) { try { return(streamVisitor.Visit(stream.GetProperty <IHttp2FrameStream>(_streamKey))); } catch (Exception cause) { OnError(_ctx, false, cause); return(false); } }