L
lw_elite
Hi all,
I'm trying to figure something out and not quite sure if I'm doing it
the right way. First, the quick overview and I'll post more info if
it's needed.
On my web site, I've got an HTTP Module that serves binaries. It
basically just reads them from disk and streams the bytes to the
client. This works fine -- every 10k I check if the client is
connected, and if so, read another 10k, etc.
I have another process that pings a few URLs using an HttpWebRequest
and HttpWebResponse. If the content type isn't plain text or HTML, I
don't try to read the site content and instantly try to close the
connection. I was hoping this would prevent the files from being
downloaded (some are quite big), but that's not the case.
If I debug both the web app and the pinging utility, I see the request
made, and the first bit of of data is pushed to the app. The app sees
the content type, and attempts to close the connection. The thing is,
the close() call doesn't return until the module is done streaming.
Each check to see if the client is connected is still returning true
(which it is, since the client hasn't disconnected yet). When the
module is done streaming the content, the close call in my app returns.
Any Ideas? Happy to post more code. Ideally I want the close call to
instantly sever the connection...
Thanks!
Tom
I'm trying to figure something out and not quite sure if I'm doing it
the right way. First, the quick overview and I'll post more info if
it's needed.
On my web site, I've got an HTTP Module that serves binaries. It
basically just reads them from disk and streams the bytes to the
client. This works fine -- every 10k I check if the client is
connected, and if so, read another 10k, etc.
I have another process that pings a few URLs using an HttpWebRequest
and HttpWebResponse. If the content type isn't plain text or HTML, I
don't try to read the site content and instantly try to close the
connection. I was hoping this would prevent the files from being
downloaded (some are quite big), but that's not the case.
If I debug both the web app and the pinging utility, I see the request
made, and the first bit of of data is pushed to the app. The app sees
the content type, and attempts to close the connection. The thing is,
the close() call doesn't return until the module is done streaming.
Each check to see if the client is connected is still returning true
(which it is, since the client hasn't disconnected yet). When the
module is done streaming the content, the close call in my app returns.
Any Ideas? Happy to post more code. Ideally I want the close call to
instantly sever the connection...
Thanks!
Tom