/// <summary>
        /// Event handler for close stream.
        /// </summary>
        /// <param name="sender">Sender object.</param>
        /// <param name="e">The event args.</param>
        private void OnCloseStream(object sender, RSTEventArgs e)
        {
            Http2Stream stream = sender as Http2Stream;

            this.streams.Remove(stream);
            this.closedStreams.Add(stream);

            if (this.OnStreamClosed != null)
            {
                this.OnStreamClosed(this, e);
            }
        }
Пример #2
0
        /// <summary>
        /// Event handler for stream reset.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.ServiceModel.Http2Protocol.RSTEventArgs"/> instance containing the event data.</param>
        private static void OnRSTReceived(object sender, RSTEventArgs e)
        {
            string filename = e.Stream.Headers[ProtocolHeaders.Path];
            if (filename == null)
            {
                filename = string.Empty;
            }

            lock (exclusiveLock)
            {
                currentStreams.CloseStream(filename);
            }

            if (rootFileName == filename)
            {
                // signal main thread to proceed
                rootFileName = string.Empty;
                rootDownloadEvent.Set();
            }

            Http2Logger.LogError("Stream reset (File not found): stream id=" + e.Stream.StreamId + " filename=" + filename);
        }
Пример #3
0
        /// <summary>
        /// Event handler for close stream.
        /// </summary>
        /// <param name="sender">The sender</param>
        /// <param name="e">Event data</param>
        private static void OnStreamClosed(object sender, RSTEventArgs e)
        {
            string filename = e.Stream.Headers[ProtocolHeaders.Path];
            if (filename == null)
            {
                filename = string.Empty;
            }

            Http2Logger.LogConsole("Stream is closed: id=" + e.Stream.StreamId);
            lock (exclusiveLock)
            {
                currentStreams.CloseStream(filename);
            }
        }
        /// <summary>
        /// Event handler for close stream.
        /// </summary>
        /// <param name="sender">Sender object.</param>
        /// <param name="e">The event args.</param>
        private void OnCloseStream(object sender, RSTEventArgs e)
        {
            Http2Stream stream = sender as Http2Stream;
            this.streams.Remove(stream);
            this.closedStreams.Add(stream);

            if (this.OnStreamClosed != null)
            {
                this.OnStreamClosed(this, e);
            }
        }