Ejemplo n.º 1
0
        public ChunkedStream(IHttpReader reader)
        {
            if (null == reader)
                throw new ArgumentNullException(nameof(reader));

            _reader = reader;
        }
Ejemplo n.º 2
0
        public void Dispose()
        {
            Stream stream = this._stream;

            if (null != stream)
            {
                this._stream = (Stream)null;
                stream.Dispose();
            }
            IHttpReader httpReader = this._reader;

            if (null != httpReader)
            {
                this._reader = (IHttpReader)null;
                httpReader.Dispose();
            }
            IHttpConnection httpConnection = this._connection;

            if (null == httpConnection)
            {
                return;
            }
            this._connection = httpConnection;
            httpConnection.Dispose();
        }
Ejemplo n.º 3
0
 public RottenTomatoesService(IStuffLibrarySettings settings, IHttpReader reader)
 {
     _settings      = settings;
     _reader        = reader;
     _reader.Accept = "application/json";
     _urls          = new ApiUrls(_settings);
 }
Ejemplo n.º 4
0
        public void Dispose()
        {
            var stream = ContentReadStream;

            if (null != stream)
            {
                ContentReadStream = null;

                stream.Dispose();
            }

            var reader = _reader;

            if (null != reader)
            {
                _reader = null;

                reader.Dispose();
            }

            var connection = _connection;

            if (null != connection)
            {
                _connection = connection;

                connection.Dispose();
            }
        }
Ejemplo n.º 5
0
 public HttpConnectionResponse(Uri url, IHttpConnection connection, IHttpReader reader, Stream stream, ILookup <string, string> headers, IHttpStatus status)
 {
     if ((Uri)null == url)
     {
         throw new ArgumentNullException("url");
     }
     if (null == stream)
     {
         throw new ArgumentNullException("stream");
     }
     if (null == headers)
     {
         throw new ArgumentNullException("headers");
     }
     if (null == status)
     {
         throw new ArgumentNullException("status");
     }
     this._url        = url;
     this._reader     = reader;
     this._stream     = stream;
     this._headers    = headers;
     this._status     = status;
     this._connection = connection;
 }
Ejemplo n.º 6
0
 public ChunkedStream(IHttpReader reader)
 {
     if (null == reader)
     {
         throw new ArgumentNullException("reader");
     }
     this._reader = reader;
 }
Ejemplo n.º 7
0
        public ContentLengthStream(IHttpReader reader, long? contentLength)
        {
            if (null == reader)
                throw new ArgumentNullException(nameof(reader));

            _reader = reader;
            _contentLength = contentLength;
        }
Ejemplo n.º 8
0
 public SearchController(
     IHttpReader reader,
     IConfigurationProvider config,
     IModel <string> model,
     SessionFactory sessionFactory) : base(config, sessionFactory)
 {
     _reader = reader;
     _model  = model;
 }
 public ContentLengthStream(IHttpReader reader, long?contentLength)
 {
     if (null == reader)
     {
         throw new ArgumentNullException("reader");
     }
     this._reader        = reader;
     this._contentLength = contentLength;
 }
Ejemplo n.º 10
0
        public HttpConnectionResponse(Uri url, IHttpConnection connection, IHttpReader reader, Stream stream, ILookup<string, string> headers, IHttpStatus status)
        {
            if (null == url)
                throw new ArgumentNullException(nameof(url));
            if (null == stream)
                throw new ArgumentNullException(nameof(stream));
            if (null == headers)
                throw new ArgumentNullException(nameof(headers));
            if (null == status)
                throw new ArgumentNullException(nameof(status));

            ResponseUri = url;
            _reader = reader;
            ContentReadStream = stream;
            Headers = headers;
            Status = status;
            _connection = connection;
        }
Ejemplo n.º 11
0
        public static async Task <string> ReadNonBlankLineAsync(this IHttpReader httpReader, CancellationToken cancellationToken)
        {
            string line;

            do
            {
                line = await httpReader.ReadLineAsync(cancellationToken).ConfigureAwait(false);

                if (null == line)
                {
                    goto label_2;
                }
            }while (string.IsNullOrWhiteSpace(line));
            goto label_4;
label_2:
            string str = (string)null;

            goto label_6;
label_4:
            str = line;
label_6:
            return(str);
        }
Ejemplo n.º 12
0
 public QueryController(IHttpReader reader, ITextModel tokenizer, ILogger <QueryController> logger)
 {
     _reader = reader;
     _model  = tokenizer;
     _logger = logger;
 }
Ejemplo n.º 13
0
 public QueryController(IHttpReader reader, IModel <string> model, ILogger <QueryController> logger)
 {
     _reader = reader;
     _model  = model;
     _logger = logger;
 }