| Reply | « Previous Thread | Next Thread » |
|
Hi!
I'm developing an application that makes an http connection every minute. It seems to work fine, but when it's working for a while, it stop to make connections. In the app log, I can see that the function urllib.urlopen is called, but it never returns. There is not timeouts or exceptions, what seems very rare. Any idea of what could be happening? Best regards. |
|
Join Date: Nov 2007
Posts: 319
Location: Sertaozinho/Brazil
marcelobarrosalmeida
Offline
Forum Nokia Champion
|
|
Hi albgarse
Are you using PyS60 1.4.5 or PyS60 1.9.5 ? Even we do not have timeout option in urllib in 1.9.5 as well (I tested today), at least it is newer and probably more stable. Marcelo Barros Nokia E71, N800, N95 and XM 5800 http://www.croozeus.com http://wordmobi.wordpress.com http://jedizone.wordpress.com |
|
I'm working with 1.4.5. I'm going to try with 1.9.5.
EDIT: Just tried, but my app won't start with the new runtime. I use some extensions that propably are no compatible. Best regards.
Last edited by albgarse : 2009-06-30 at 08:53.
|
|
Join Date: Feb 2008
Posts: 2,543
Location: Bhavnagar, Gujarat, India
gaba88
Online
Forum Nokia Champion
|
|
|
Quote:
ya all extensions are not working with 1.9.x releases so always make a note of that. Regards Gargi Das- http://gargidas.blogsot.com Forum Nokia Python Wiki Learn Python at http://mobapps.org/PyS60 |
|
I found a possible solution here:
http://mail.python.org/pipermail/pyt...il/001307.html It uses a code like this to force a timeout: Code:
import signal
def alarmHandler(*args):
"""
signal handler for SIGALRM, just raise an exception
"""
raise "TimeOut"
....
signal.signal(signal.SIGALRM, alarmHandler)
try:
# set timeout
signal.alarm(120)
#... urllib.urlretrieve pages
except "TimeOut":
# some error handling
signal.alarm(0)
I'm trying with e32.Ao_Timer() Code:
def timeoutHandler():
raise IOError, "Timeout error"
try:
timer = e32.Ao_timer()
timer.after(120,timeoutHandler)
# comms. function here...
timer.cancel()
except:
# capture exception here...
is there a solution to raise the exception to the thread from where the timer was triggered? regards. |
|
I've been making some more tryings. It's a bit rare.
The phone opens a communication every minute with urllib.urlopen() and it works fine. Some hours after, one communication fails. it don't return from urlopen() and every call to urlopen() after this fails in the same way. There is not any memory problem. The free ram don't go down. Is urlopen() function reentrant? so if one fails, could I make another urlopen() from other thread (have two urlopen() working at the same time)? It seems a little rare that once one communication fails, every communication after fails too. Regards. |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| OBEX/Bluetooth: getReceivedHeaders() returns null | schoenke | Mobile Java General | 5 | 2009-01-30 17:18 |
| Publish&Subscribe problem: RProperty:Set returns KErrPermissionDenied | mrtj | Installation, Certification and Security | 8 | 2008-08-05 01:43 |
| ExampleClientEngine ... | GeKI | Symbian Networking & Messaging | 2 | 2005-12-16 08:12 |
| Personal | JSmith77 | PersonalJava | 4 | 2003-07-30 13:52 |
| AT Command: Nokia 6310i return “Nokia 6310i”, and others returns “Nokia 6310” | basti111 | PC Suite API and PC Connectivity SDK | 1 | 2003-07-27 11:31 |