You Are Here:

Community: Developer Discussion Boards

#1 Old Force WAP/GPRS connection to close - 2008-08-21, 20:16

Join Date: Aug 2008
Posts: 28
skewlboy
Offline
Registered User
I am porting an application I had in J2ME to PyS60 (mainly because of the being able to save a default access point lol). It's an application that's meant to run in background and checks a webpage every hour. In JavaME I had no control over the connection, but after closing all streams, my phone (E65) closed the connection after a minute or so (never timed it, any info on this would appreciated too, for curiosity ).
But since in Python I see we have so much more control than in java I was wondering if there's any way to shut the connection down myself instead of waiting for it to close.
Or better, does it even close after some time inacive, like JavaME? Because I've had the script open but inactive in PythonShell for a while now (like 20min) and the connection is still up though.

Thank you
Reply With Quote

#2 Old Re: Force WAP/GPRS connection to close - 2008-08-21, 21:56

Join Date: Jul 2008
Posts: 25
Location: Tokyo, Japan
Hiisi
Offline
Registered User
Quote:
Originally Posted by skewlboy View Post
I was wondering if there's any way to shut the connection down myself instead of waiting for it to close.
You can manually stop the access point
Code:
import socket
apid = socket.select_access_point()
ap = socket.access_point(apid)
ap.start()
print ap.ip()    # This line is just an example...
ap.stop()        # Stop the access point.
Reply With Quote

#3 Old Re: Force WAP/GPRS connection to close - 2008-08-21, 22:28

Join Date: Aug 2008
Posts: 28
skewlboy
Offline
Registered User
That was exactly it, thanks!
Manual labor sucks, socket.ap.close()
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
Close HTTp Connection in N6230i cars2004 Mobile Java General 1 2005-06-24 11:46
Close HTTp Connection in N6230i cars2004 Mobile Java Networking & Messaging & Security 0 2005-06-24 10:29
open and close connection in the MMS Library cmingoia General Messaging 1 2002-09-17 11:54
close a wap connection in j2me hadam Mobile Java General 0 2002-08-29 07:38
Close data connection frhan PersonalJava 1 2002-07-31 13:06

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