You Are Here:

Community: Developer Discussion Boards

#1 Old GPRS Connection doesnt close correctly - 2005-09-18, 04:46

Join Date: Jul 2005
Posts: 26
Location: Trento - ITALY
Xen0n's Avatar
Xen0n
Offline
Registered User
Hi ppl, im having a little problem with the socket in python... hope u can help me

I have a piece of code where i use the .connect method for connecting at my pc from phone... i exchange some data and bla bla bla and the i'll call the .close() method of the socket... the problem is that the connection is still open... the only way to close the connection is close my app. Can u resolve this issue? tnks in advance!
Reply With Quote

#2 Old Re: GPRS Connection doesnt close correctly - 2005-09-19, 09:41

Join Date: Dec 2004
Posts: 646
jplauril's Avatar
jplauril
Offline
Forum Nokia Expert
Are you using Bluetooth or TCP/IP? What kind of data exchange do you do? Plain send and recv?
Reply With Quote

#3 Old Re: GPRS Connection doesnt close correctly - 2005-09-19, 14:06

Join Date: Jul 2005
Posts: 26
Location: Trento - ITALY
Xen0n's Avatar
Xen0n
Offline
Registered User
Hi men, this is the code for my software... i think this is correct... :P let me know where is the error... Also, if u know, tell me how to remove that damn popup with the connection name when i use the .connect method! tnks!

..server="test.test.org"
..porta=5556
..sock=socket(AF_INET,SOCK_STREAM)
..sock.connect((server,porta))
..risultato="TEST"
..sock.send(risultato)
..Buffer=""
..Ch = sock.recv(1)
..while(Ch !='/'):
....Buffer+=Ch
....Ch = sock.recv(1)
....sock.close()
Reply With Quote

#4 Old Re: GPRS Connection doesnt close correctly - 2005-09-23, 20:40

Join Date: Jul 2005
Posts: 26
Location: Trento - ITALY
Xen0n's Avatar
Xen0n
Offline
Registered User
man, im waiting for a reply.......
Reply With Quote

#5 Old Re: GPRS Connection doesnt close correctly - 2005-09-28, 18:09

Join Date: Dec 2004
Posts: 646
jplauril's Avatar
jplauril
Offline
Forum Nokia Expert
Verified that the network connection stays open until the application exits. Possibility to close the network connection filed as enhancement request, id 246.
Reply With Quote

#6 Old Re: GPRS Connection doesnt close correctly - 2005-09-30, 13:49

Join Date: Jul 2005
Posts: 26
Location: Trento - ITALY
Xen0n's Avatar
Xen0n
Offline
Registered User
Quote:
Originally Posted by jplauril
Verified that the network connection stays open until the application exits. Possibility to close the network connection filed as enhancement request, id 246.
Many thkns man... i really like u! Plz finally consider the possibility to set a connection as default without making that damn connection list to popup! One api to retrieve the connection and one to set a connection as default! let me know! tnks!
Reply With Quote

#7 Old Re: GPRS Connection doesnt close correctly - 2005-10-02, 17:52

Join Date: Aug 2004
Posts: 290
simo.salminen
Offline
Regular Contributor
EDIT: Added fixed version of this module.

As I've understood, it is not possible to pre-connect to internet access point in a way that s60/python sockets would re-use that connection. S60/python will always display the internet access point dialog.

However, it is possible to implement your own socket. It is not pretty, nor perfect, but it gets the job done.

Here it is:

iapconnect - tcp/ip socket for s60/python that enables automatic connection to specified internet access point.

This horrible kludge works only with 2nd ed. or later phones (6600>=).
Tested only with 7610.

Download: http://pymbian.sourceforge.net/misc/iap-v0.20051006.zip

Example:
Code:
import e32
import urllib
import iapconnect

# return value 0 means that user canceled
default_iap = iapconnect.iap_selection_dialog()

conn = iapconnect.Connection()
conn.connect(u"www.google.com", 80, default_iap)
print "connected.."
conn.send("GET / HTTP/1.0\n\n")
print "sent request"

buf = []
while 1:
    data = conn.recv(1024)
    print data
    if not data:
        break
    buf.append(data)

buf = ''.join(buf)

appuifw.note(unicode(buf[:100]), 'info')

#conn.close() # this will disconnect, but leave gprs active
conn.stop() # this will shutdown the gprs connection
Note, that if you just wan't to close down the connection after the s60/python socket has used it, you can do it, but you have to modify the c++ module a bit (in short, use RConnection.Start to same IAP as s60/python uses, then call Stop).
Last edited by simo.salminen : 2005-10-06 at 22:20.
Reply With Quote

#8 Old Smile Re: GPRS Connection doesnt close correctly - 2007-05-29, 09:19

Join Date: May 2007
Posts: 6
jiveright
Offline
Registered User
Quote:
Originally Posted by jplauril
Verified that the network connection stays open until the application exits. Possibility to close the network connection filed as enhancement request, id 246.
does anyone out there have any workaround at all for closing a network connection without exiting a java MIDlet on Series 40 phones? We need to keep the java application running, but disconnect GPRS.

thanks!
Reply With Quote

#9 Old Re: GPRS Connection doesnt close correctly - 2007-05-29, 13:25

Join Date: May 2006
Posts: 622
Location: Oulu, Finland
lfd
Offline
Super Contributor
Hi jiveright and welcome to Nokia Forum,

You just posted a question on the Python part of the forum. You better try on the Java one, you'll get more chances for an answer.

LFD


Devices:
Nokia E61 3rd Edition - pys60 1.4.0

Tips and modules:
http://www.lfdm.net/thesis
Reply With Quote

#10 Old Re: GPRS Connection doesnt close correctly - 2007-05-29, 14:08

Join Date: Dec 2004
Posts: 646
jplauril's Avatar
jplauril
Offline
Forum Nokia Expert
jiveright, you mailed me a question but your FN profile doesn't permit me to send you mail.
Reply With Quote

#11 Old Re: GPRS Connection doesnt close correctly - 2007-05-29, 16:03

Join Date: May 2007
Posts: 6
jiveright
Offline
Registered User
Quote:
Originally Posted by jplauril
jiveright, you mailed me a question but your FN profile doesn't permit me to send you mail.
Sorry, I did not intend to configure it so. Can you write me at jiverite@hotmail.com please?
Reply With Quote

#12 Old Re: GPRS Connection doesnt close correctly - 2007-05-31, 08:26

Join Date: May 2007
Posts: 6
jiveright
Offline
Registered User
Quote:
Originally Posted by jplauril
jiveright, you mailed me a question but your FN profile doesn't permit me to send you mail.
I have fixed this, would you like to mail me now? thanks
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 bug ??? cars2004 Mobile Java General 11 2006-08-26 02:35
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
MMS Interruption during GPRS connection hangs the device? alexhong Mobile Java Networking & Messaging & Security 0 2004-08-31 19:47
MMS Interruption during GPRS connection hangs the device? alexhong Mobile Java General 0 2004-08-31 19:45

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