You Are Here:

Community: Developer Discussion Boards

#1 Old Stop socket's bluetooth accept() - 2008-05-11, 00:28

Join Date: Apr 2008
Posts: 16
bmichel's Avatar
bmichel
Offline
Registered User
Once I've started server.accept(), how can I stop it correctly (for example if the user hits exit) so that I am able to restart it a second time in the same fashion (the user wants to start it again)

What part of my code looks like:
Code:
server = socket.socket(socket.AF_BT, socket.SOCK_STREAM)
channel = socket.bt_rfcomm_get_available_server_channel(server)
server.bind(("", channel))
server.listen(1)
socket.bt_advertise_service(unicode(SERVICE_NAME), server, True, socket.RFCOMM)
socket.set_security(server, socket.AUTH | socket.AUTHOR)
conn, client_addr = server.accept()
# Once here, the phone application just waits, nothing happens
Notes:
- server.close() doesn't accomplish the desired effect. I already tried it.
- I am able to accomplish the desired effect IF a client connects, than I can close the connection; and doing the whole process again works well. The problem is that if noone connects, the accept() just seems to hang.
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
Bluetooth GPS simulator for j2me phone vgps Mobile Java Networking & Messaging & Security 2 2007-02-09 05:30
bluetooth sockets bunty General Symbian C++ 3 2006-11-21 07:47
regarding bluetooth listening sockets. architgupta Symbian Networking & Messaging 1 2005-07-28 15:29
Bluetooth statuspane icon antijn Bluetooth Technology 2 2004-10-30 10:23
PC Suite not detect 6600 with Bluetooth connection spinacle Bluetooth Technology 29 2004-03-15 00:24

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