When downloading a ~1 MB image file, the script dies due to a closed socket in ~30 minutes.
As expected:
1,000,000 (bytes) / 512 (bytes/second) = 1953 seconds = 32.5 minutes.
…
I'm starting to wonder how much utility this approach really provides.
It raises the bar, as you said. It's also simple to implement, has no performance penalty and is a fine default - Molly…
Interesting. After conn.Close(), the server keeps sending data that was written to the buffer, but only if SetLinger is enabled. So I guess you can…
Never mind, I have now actually read your earlier comments in their entirety and see where you explicitly explained why you wanted to wait for the deadline to expire. Sorry for my inattentiveness…
I seem to remember that dialup circa 2000 was a little faster than 1KB/s, at least on most nights.
I wished. But, yes, I hear it was better for others.
Hmm? If we aren't chunking the…
I guess I will try the approach of, by default, setting a single write deadline with a time derived from the filesize and a slow download rate of 1KB/s
1 KB/s is what I had on dial-up around…
But only the read deadline can be extended after it passes, not the write deadline - not sure if it's a bug or if I'm doing something wrong.
It turns out that the write deadline can be…
@makeworld: Thanks for catching that! Another problematic case is that of CGI scripts keeping a connection open for streaming output - the deadline needs to be updated after each write.
@solde…