This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients gvanrossum, vstinner, yselivanov
Date 2015-01-14.00:49:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1421196575.55.0.521144393269.issue23236@psf.upfronthosting.co.za>
In-reply-to
Content
Copy of the feature requets by Guido van Rossum:
https://code.google.com/p/tulip/issues/detail?id=96

Often you want to stop servicing (or using) a connection when there is no activity in a given time.  You can do this by wrapping all your read calls in wait_for(), but a single readline() or readexactly() call may do multiple I/O operations and typically you want to reset the timeout whenever you receive some more bytes.  So it makes more sense to either add the timeout to the various read*() calls, or even to (optionally) set it in the constructor, so that the class can implement a more subtle timeout algorithm.

I could imagine an overall timeout too, and possibly even something that gives up if the bandwidth goes below a threshold, to avoid waiting forever on a huge download.

(For StreamWriter I think it's sufficient to call wait_for(w.drain()), so I think this only applies to StreamReader.)
History
Date User Action Args
2015-01-14 00:49:35vstinnersetrecipients: + vstinner, gvanrossum, yselivanov
2015-01-14 00:49:35vstinnersetmessageid: <1421196575.55.0.521144393269.issue23236@psf.upfronthosting.co.za>
2015-01-14 00:49:35vstinnerlinkissue23236 messages
2015-01-14 00:49:34vstinnercreate