Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #51698
| From | "Prasad, Ramit" <ramit.prasad@jpmorgan.com.dmarc.invalid> |
|---|---|
| Subject | RE: pcurl and network connection's problem |
| Date | 2013-07-31 19:32 +0000 |
| References | <2271ec9a-ec36-485b-9776-3c7157cedae1@googlegroups.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.53.1375299192.1251.python-list@python.org> (permalink) |
sam319 wrote: > I am having problems with pycurl in my threads , when i run it , it does correctly but some times the > connection has been established but nothing will be downloaded and the threads stay alive without > doing any thing (especially when the network's speed is slow and has aborted status) . > > i can't use TIMEOUT because i don't have the max time for downloading > > how can i solve this problem in python So you want to wait hours/days/years for a failed download? You should always set a timeout that is sane. If you anticipate network slowness, then set your timeout to something larger like 2-3 minutes. IIRC, the timeout only affects connection establishment so that will not help out your use case but I want to emphasize that you always want a timeout to be set. Pycurl has an option for LOW_SPEED_LIMIT/LOW_SPEED_TIME which should allow you to set a minimum transfer speed which will abort the transfer. This should solve your problem where the connection is created but nothing is being downloaded. See: http://stackoverflow.com/questions/4960021/handle-pycurl-hang-on-twitter-streaming-api Ramit This email is confidential and subject to important disclaimers and conditions including on offers for the purchase or sale of securities, accuracy and completeness of information, viruses, confidentiality, legal privilege, and legal entity disclaimers, available at http://www.jpmorgan.com/pages/disclosures/email.
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
pcurl and network connection's problem sam319 <samaneh.yahyapour@gmail.com> - 2013-07-31 12:12 -0700 RE: pcurl and network connection's problem "Prasad, Ramit" <ramit.prasad@jpmorgan.com.dmarc.invalid> - 2013-07-31 19:32 +0000
csiph-web