private void ReadThread()
        {
            try
            {
                DataFrame frame = _input.Dequeue();

                while (frame != null)
                {
                    // Call original Input method to kick off process
                    base.Input(frame);

                    frame = _input.Dequeue();
                }
            }
            catch (ThreadAbortException)
            {
                throw;
            }
            catch (OperationCanceledException) { }
            catch (ObjectDisposedException) { }
            catch (Exception ex)
            {
                Graph.Logger.LogException(ex);
            }

            // Stop anything more arriving
            _input.Stop();

            if (!_isDisposed)
            {
                ShutdownOutputs();
            }
        }
Exemple #2
0
            protected override IEnumerable <DataFrame> GetFrames()
            {
                ProxyConnection conn = _conns.Dequeue();

                while (conn != null)
                {
                    bool receivedFinal = false;

                    foreach (HttpResponseDataChunk chunk in conn.ResponseReader)
                    {
                        receivedFinal = chunk.FinalChunk;
                        yield return(chunk.ToDataFrame());
                    }

                    // If we didn't receive final chunk we have an error, start shutdown
                    if (!receivedFinal)
                    {
                        _conns.Stop();
                        break;
                    }

                    conn = _conns.Dequeue();
                }

                lock (_graphs)
                {
                    foreach (NetGraph graph in _graphs)
                    {
                        _service.CloseConnection(graph);
                    }
                }
            }
Exemple #3
0
 /// <summary>
 /// Close the write queue down, this will cause the Read() method to return null when no more data
 /// </summary>
 public void StopEnqueue()
 {
     _outputQueue.Stop();
 }
Exemple #4
0
 /// <summary>
 /// Dispose method, only closes input queue so you can no longer write to it
 /// </summary>
 /// <param name="disposing"></param>
 protected override void OnDispose(bool disposing)
 {
     _inputQueue.Stop();
 }
Exemple #5
0
 public void StopInput()
 {
     _inputQueue.Stop();
 }