You Are Here:

Community: Developer Discussion Boards

#1 Old application blocked - 2009-01-28, 23:20

Join Date: Nov 2008
Posts: 140
widetech1
Online
Regular Contributor
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 With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
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

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia