You Are Here:

Community: Developer Discussion Boards

#1 Old [Socket] Frozen application - 2009-06-29, 15:20

Join Date: Apr 2009
Posts: 2
jondavisofkorn
Offline
Registered User
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 15:31.
Reply With Quote

#2 Old Re: [Socket] Frozen application - 2009-06-30, 03:04

Join Date: Nov 2007
Posts: 317
Location: Sertaozinho/Brazil
Send a message via MSN to marcelobarrosalmeida Send a message via Skype™ to marcelobarrosalmeida
marcelobarrosalmeida's Avatar
marcelobarrosalmeida
Online
Forum Nokia Champion
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.


Marcelo Barros
Nokia E71, N800, N95 and XM 5800
http://www.croozeus.com
http://wordmobi.wordpress.com
http://jedizone.wordpress.com
Reply With Quote

#3 Old Re: [Socket] Frozen application - 2009-07-02, 21:21

Join Date: Apr 2009
Posts: 2
jondavisofkorn
Offline
Registered User
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
Reply With Quote

#4 Old Re: [Socket] Frozen application - 2009-07-03, 22:41

Join Date: Nov 2007
Posts: 317
Location: Sertaozinho/Brazil
Send a message via MSN to marcelobarrosalmeida Send a message via Skype™ to marcelobarrosalmeida
marcelobarrosalmeida's Avatar
marcelobarrosalmeida
Online
Forum Nokia Champion
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


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
AutoStart My application at bootup prakashs General Symbian C++ 7 2009-03-24 11:06
Please Help! application runs on emulator but doesnt run on phone qt_chenchen General Symbian C++ 37 2008-07-16 06:17
Cannot run console application on S60 3rd gen (nokia 6110 navigator) mcbure General Symbian C++ 4 2008-07-15 12:37
BIO Message Parser Starting Application + Security Hole ? Cr7pt0r General Symbian C++ 1 2008-05-08 13:32
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 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d81449X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZpythonQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZuserE5ftagQSxpythonX qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ