×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Apr 2009
    Posts
    2

    [Socket] Frozen application

    Hello I have a problem with my application..now I try to explain..
    I have a class method that use "socket" from library socket..

    Code:
    sock_im=socket(AF_INET,SOCK_STREAM)
    sock_im.connect((ip, port))
    f_im=sock_im.makefile("rb")
    after that it loops in listening with:

    Code:
    while 1:
    	try:
    		risp=f_im.readline()
    	except:
    		#error
    		f_im.close()

    In this method there isn't recursion and I use other external library:
    pykeylock
    msys
    appswitch
    appuifw2

    Now my problem is that if I use gprs connection the application is blocked after 19/20 minutes of socket inactivity and I must kill it. If I use gprs connection it takes 30 minutes about. I try with different phone model and I look that on e51 with wifi after 2 hours there aren't problems.

    Can you help me?.. I also monitored the ammount of free ram but it is always sufficient for the program

    I use pys60 1.4.5.
    Last edited by jondavisofkorn; 2009-06-29 at 14:31.

  2. #2
    Super Contributor
    Join Date
    Nov 2007
    Location
    Sertaozinho/Brazil
    Posts
    768

    Re: [Socket] Frozen application

    Hi jondavisofkorn

    Code:
    while 1:
    	try:
    		risp=f_im.readline()
    	except:
    		#error
    		f_im.close()
    Since readline() will return an empty string when the connection is closed, not an exception (I tested this behavior in Python 2.6), your code may not detect when the connection was closed. And, after f_im.close(), it does not leaves the loop. I was expecting some re-connection stuff here.

  3. #3
    Registered User
    Join Date
    Apr 2009
    Posts
    2

    Re: [Socket] Frozen application

    But I use PyS60 1.4.5.. it has the same behavior?
    However in the next post I'm going to post the complete method so you can see all the code

    Thanks for your reply

  4. #4
    Super Contributor
    Join Date
    Nov 2007
    Location
    Sertaozinho/Brazil
    Posts
    768

    Re: [Socket] Frozen application

    Quote Originally Posted by jondavisofkorn View Post
    But I use PyS60 1.4.5.. it has the same behavior?
    In this case, yes. Or we have a found bug !
    I will try to test in 1.4.5

Similar Threads

  1. AutoStart My application at bootup
    By prakashs in forum Symbian
    Replies: 7
    Last Post: 2009-03-24, 10:06
  2. Replies: 37
    Last Post: 2008-07-16, 05:17
  3. Replies: 4
    Last Post: 2008-07-15, 11:37
  4. Replies: 1
    Last Post: 2008-05-08, 12:32
  5. Replies: 0
    Last Post: 2005-05-28, 10:20

Posting Permissions

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