Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to flush HttpListener response stream?

HttpListener gives you response stream, but calling flush means nothing (and from sources it's clear, because it's actually doing nothing). Digging inside HTTP API shows that this is a limitation of HttpListener itself.

Anyone knows exactly how to flush response stream of HttpListener (may be with reflection or additional P/Invokes)?

Update: You can't http stream anything if you don't have a flush option or ability to define buffer size.

like image 548
Mash Avatar asked Apr 27 '09 16:04

Mash


1 Answers

Flush only works in most of the System.Net namespace when Transfer-Encoding is set to Chuncked, else the whole request is returned and Flush really does nothing. At least this is what I have experienced while working with HttpWebResponse.

like image 178
Nick Berardi Avatar answered Oct 27 '22 01:10

Nick Berardi