| Reply | « Previous Thread | Next Thread » |
|
I'm using the standard socket module (not btsocket) for multiple tcp connections in my pys60 1.9.2 application.
Is there any means to set the default access point before establishing connection? set_default_access_point()-function is moved to btsocket-module and does not have effect when using the standard socket module. |
|
I believe the answer is no. If you want to avoid access point selection, you'll have to create the socket with the btsocket.socket() rather than the socket.socket().
|
|
I've got a related problem, I want to get data from a http URL using urllib - but even though i do the btsocket.set_default_acces_point() etc. it keeps asking me every time i run the script that uses urllib
|
|
Quote:
This should work consistently on all versions... Code:
import sys
# Try to import 'btsocket' as 'socket' - ignore on versions < 1.9.x
try:
sys.modules['socket'] = __import__('btsocket')
except ImportError:
pass
# For v1.9.x - Import the 'btsocket' module as 'socket'
# For v1.4.x - Import 'socket' module
import socket
# Set up AP
apid = socket.select_access_point()
apo = socket.access_point(apid)
socket.set_default_access_point(apo)
# Now importing urllib should use 'btsocket' instead of 'socket' on v1.9.x
import urllib
|
|
Join Date: Nov 2007
Posts: 494
Location: Sertaozinho/Brazil
marcelobarrosalmeida
Offline
Forum Nokia Champion
|
|
I think you solved my problem as well (in Wordmobi), aya42 ;-) Thanks !
Testing ... Marcelo Barros Nokia E71, N800, N95, XM5800, N900 http://www.croozeus.com http://blog.nokiabr.com.br |
|
Quote:
|
| mahesh.sayibabu |
| View Public Profile |
| Find all posts by mahesh.sayibabu |
|
Join Date: Nov 2007
Posts: 494
Location: Sertaozinho/Brazil
marcelobarrosalmeida
Offline
Forum Nokia Champion
|
|
Tested and running fine !
For those that do not know Python so well as aya42, an explanation about sys.modules from Dive into Python. Marcelo Barros Nokia E71, N800, N95, XM5800, N900 http://www.croozeus.com http://blog.nokiabr.com.br |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Transforming WiFi connectivity and access point creation script to python module | oguzkirat | Python | 3 | 2009-10-10 20:34 |
| Nokia 3555 WAP Access Point Problem | kamyu2881 | Mobile Java Networking & Messaging & Security | 2 | 2008-11-25 14:55 |
| Access Point Connection Problem on N96... Help! | asenechalM5T | Symbian Networking & Messaging | 4 | 2008-11-17 16:00 |
| Changing J2ME access point on 7270 | aidygallagher | Mobile Java General | 2 | 2006-10-23 19:52 |
| selecting access point by code | gauravj116 | Symbian Networking & Messaging | 3 | 2004-11-09 05:55 |