| Reply | « Previous Thread | Next Thread » |
|
hi friends,
I have a problem running the following code, I'm doing a test case the server is not available on this, when start the thread, the application is blocked beetwen print "1" and print "2", how could it do to do not keep trying to send data, if not following the exception? Note: I run the code without any server is listening Code:
import time
from threading import Thread
import e32
import socket
SERVER = ("localhost",80)
msg = None
aux = False
soc = None
flag = False
class MiThread(Thread):
def __init__(self):
Thread.__init__(self)
def run(self):
sock=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
conn = True
serv = True
while conn:
while conn and serv:
try:
sock.connect(SERVER)
serv = False
except:
print"ex"
e32.ao_sleep(10)
try:
print"1"
sock.send("datas")
print"2"
except:
#appuifw.note(u"no conect")
serv = True
thr1=Mythread()
thr1.start()
|
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| AutoStart My application at bootup | prakashs | General Symbian C++ | 7 | 2009-03-24 11:06 |
| Updating an application | Alfury | Mobile Java Networking & Messaging & Security | 2 | 2008-04-08 17:56 |
| Problems with a signed application | Alfury | Mobile Java Networking & Messaging & Security | 7 | 2008-03-27 06:15 |
| 3250: Too many SMSs received crash the application | kewldeep | Mobile Java General | 4 | 2007-01-27 01:00 |
| Not able to deploy an updated application on the mobile -it deploys a new application | kishban | Mobile Java General | 0 | 2005-05-28 11:20 |