Exemplo n.º 1
0
        public async Task ServeLongFile()
        {
#warning need To Implement This Example
            byte[] test = new byte[100000000];
            Response.AddContentLenght(test.Length);
            await WriteDataAsync(test);
        }
Exemplo n.º 2
0
        internal async Task SendTextAsync(string input)
        {
            Response.AddContentType(ContentType.PlainText);
            Response.AddContentLenght(input.Length);

            await WriteHeadersAsync().ConfigureAwait(false);

            var writer = new StreamWriter(NetworkStream);
            await writer.WriteAsync(input).ConfigureAwait(false);

            await writer.FlushAsync().ConfigureAwait(false);
        }