listening socket not notified when bluetoothd stops, but becomes unusable
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?
Luiz Augusto von Dentz
maintainerHi,
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
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.