c# - how to implement stream readtimeout property -
i'm fixing bug : app hang in download process 5 minutes while losing network connection. need reduce hanging time 20 seconds. log snippet: severe 2016-01-27 , 11:03:14 在 httpsdownload.dodownloadbyhttps(filedownloadinfo fileinfo, downloadingdelegate downdelegate) message: init method:get info 2016-01-27 , 11:08:29 在 httpsdownload.writetofile(filedownloadinfo fileinfo, stream stream, downloadingdelegate downdelegate, boolean clear) message: exception while reading response stream exception: message: time out type: system.net.webexception 在 system.net.connectstream.read(byte[] buffer, int32 offset, int32 size) 在 httpsdownload.writetofile(filedownloadinfo fileinfo, stream stream, downloadingdelegate downdelegate, boolean clear) code snippet: private void dodownloadbyhttps(filedownloadinfo fileinfo, downloadingdelegate downdelegate) { //code webresponse = (httpwebresponse)webreques...