I have a BT application (on Nokia 7650) that communicates with a Serial Port Service on a PC. When the application has an outstanding receive operation I disconnect from the PC side.
In the EPOC code the receive operation is completed with KErrDisconnected. When detecting this event, I close the connection from the phone side using RSocket::Shutdown(...). When this completes I initiate a new connection request, which always results in an error that the max. number of bluetooth connections are already in use. After some seconds the connection attempt is successful. It looks as if the completion of the shutdown request did not mean the the connection is really broken down.
What is the correct way to detect that the connection is really terminated? Or what can be the reason of the above mentioned unsuccessful reconnection attempt?
(I could reproduce the same problem with the BTPointToPoint example from the SDK.)