You Are Here:

Community: Developer Discussion Boards

#1 Old KERN-EXEC 3 - 2009-01-26, 16:18

Join Date: Nov 2008
Posts: 139
widetech1
Offline
Regular Contributor
hi,

I am using the following code to send and receive data from a server using TCP / IP, to send and receive data using two different threads, when the application tries to receive data on line con.recv (8192) comes out of the application and shows a KERN-EXEC 3.


Code:
import socket
import thread
     .
     .

SERVER = ("localhost", 80)
con = None

class ConPrueba:

 def send(self):
     global con
     try:
        con = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        con.connect((SERVER))
        self.con.send("datas")
     except:
        print "don't send"

 def receiver(self):
    e32.ao_sleep(20)
    timeout=2
    con.setblocking(0)
    total_data=[];data='';begin=time.time()
    while 1:
        #if you got some data, then break after wait sec
        if total_data and time.time()-begin>timeout:
            break
        #if you got no data at all, wait a little longer
        elif time.time()-begin>timeout*2:
            break
        try:
            data=con.recv(8192)
            if data:
                total_data.append(data)
                begin=time.time()
            else:
                time.sleep(0.1)
        except Exception,ex:
           print ex
p = ConPrueba()
thread.start_new_thread(p.send,())
thread.start_new_thread(p.receiver,())
Thank you
Reply With Quote

#2 Old Re: KERN-EXEC 3 - 2009-01-27, 01:34

Join Date: Nov 2007
Posts: 319
Location: Sertaozinho/Brazil
Send a message via MSN to marcelobarrosalmeida Send a message via Skype™ to marcelobarrosalmeida
marcelobarrosalmeida's Avatar
marcelobarrosalmeida
Offline
Forum Nokia Champion
Hi (again) !

I had several problems using multi-thread and sockets in versions before 1.9.0. To be honest, I was trying to solve them when 1.9.0 was released. So, with 1.9.0 I could use threading module and things became much easier. I had just a small problem related to socket library used in console but it seems to be solved in 1.9.1. From the changelog:

Quote:
The default mode of ensymble py2sis command is changed to 'pycore'. All scripts which refer to pys60 modules socket and calendar should use the new names - btsocket and e32calendar to use the S60 functionality in pycore mode. Also renamed "Prioritize PyS60 module library" to "1.4.x compatibility mode" on the UI of application packager.
Remember: use ensymble provided by 1.9.1 !


Marcelo Barros
Nokia E71, N800, N95 and XM 5800
http://www.croozeus.com
http://wordmobi.wordpress.com
http://jedizone.wordpress.com
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
Listbox in dialog gives 'Kern Exec 3' on mobile hansapariya Symbian User Interface 1 2009-07-24 08:01
KERN EXEC 3 on device not on Epoc Kavit Patel General Symbian C++ 4 2008-11-21 16:02
KERN EXEC 3 ERROR sanjayks84 Symbian User Interface 3 2008-05-28 10:13
KERN EXEC 3 while deleting listbox hansapariya General Symbian C++ 4 2008-03-29 10:09
why kern exec 3 on CopyFile? flicker82 General Symbian C++ 2 2005-05-16 03:25

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