This project has moved. For the latest updates, please go here.

BluetoothListener Closing?

Topics: Bluetooth - Widcomm/Broadcom
Feb 13, 2012 at 5:08 PM

I notice that there isn't a close method for the bluetooth listener class... 

I have been getting an issue where i can connect two devices once, however after closing the connection on the client side with the, bluetoothclient.close() method. 

when running the program again, using the same uuid to create a new listener, this new listener no longer accept the connection, as if the old listener was never destroyed and took away the connection.. 

Feb 14, 2012 at 2:24 PM

What platform?  Desktop Windows or Mobile?  Which stack Microsoft, Widcomm, etc? (e.g. BluetoothRadio.PrimaryRadio.SoftwareManufacturer).  Also it would be interested to know if the client is running on Widcomm.

If you are leaving the program with the listener running, then the simples solution is only to create one BluetoothListener and accept multiple connections through it.  Otherwise there is a Stop method on BluetoothListener, call is to 'close' and it will clear the SDP record that is causing the confusion.

Feb 15, 2012 at 4:00 PM

desktop windows. boardcom. 

the client has the exact set up as the server. 

The program, connects on first attempt. It connects via, BeginAcceptBluetoothClient, then detects a connection, OnBluetoothConnect is called, it calls EndAcceptBluetoothClient. program does some communication on streams, then program ends.

A new instance of the program starts, the client tries to connect, on the windows bluetooth icon in the notification area, it shows that the bluetooth connected, however my bluetoothlistener, the OnBluetoothConnect () method isn't getting called



I will try the stop function. 

Feb 16, 2012 at 6:01 PM

Let me know what you find. :-)

Feb 20, 2012 at 7:20 PM

it has worked! Stop () does the trick 

thank you! 

Feb 23, 2012 at 11:46 PM


Feb 24, 2012 at 8:18 PM

also just in addition, i'm starting to get a 

widcommsocketerror, 0x80004005. PORT_RETURN_CODE = UNKOWN_ERROR      once this error appears i can no longer even reopen a server...(listener). however resarting the computer instantly fixes this.. would you have idea as to what is causing this?

Feb 26, 2012 at 4:28 PM

Who knows what Widcomm is doing? :-(  Can you move to another stack, e.g. the Microsoft stack?  What was the platform? Desktop Windows? XP?