Skip to contentSkip to conversation

listening socket not notified when bluetoothd stops, but becomes unusable

DISCUSSION Ilya Basin 2 participants 3 messages Jan 5, 2011 Bluetooth drivers

lore
Share & tools
lore

Ilya Basin

author
#0 lore raw

I use nonblocking sockets and select(). When I restart bluetoothd, select() doen't return, but the listening socket won't accept connections anymore. How to handle this correctly?

#1 lore raw

Hi,

Quoted 3 lines · Ilya Basin

I use nonblocking sockets and select(). When I restart bluetoothd, select() doen't return, but the listening socket won't accept connections anymore. How to handle this correctly?

If you are using BDADDR_ANY than that is probably ok, now for specific adapter this could be a bug but Im not sure about the powered state before you restart and if RememberPowered is set, it could be that the adapter is powered off after bluetoothd restart than you won't be able to accept connections.

Signature · 2 lines
Luiz Augusto von Dentz
Computer Engineer
author
#2 lore raw

Hi.
LAvD> If you are using BDADDR_ANY than that is probably ok, now for specific LAvD> adapter this could be a bug
I just copied the code from someone else's project:
sdpSession = sdp_connect(BDADDR_ANY, BDADDR_LOCAL, SDP_RETRY_IF_BUSY);

I understand now, why select() doesn't return, but I still can't connect.

LAvD> adapter is powered off after bluetoothd restart than you won't be able LAvD> to accept connections.
If I restart my program after restarting bluetoothd, it accepts connections.