Hi all,
I have written a code for listening a bluetooth connection, but the problem with the code is that it is capable of accepting only one connection. I mean it is listening to only one connection. I have tried to specify the number of connection but then also the result is same below is the code which I have used.
// I have used this for attaching the security settings.
btsockaddr.SetSecurity(secSettings);
// This used for Binding bluetooth socket which is CBluetoothSocket)
User::LeaveIfError(iListenSock->Bind(btsockaddr));
// I have used this for listening the port
iListenSock->Listen(KSizeOfListenQueue); //this is 5
// I have used this for Opening the blank socket and then pass it to accept to be assigned a proper
// And the socket upon completion of Accept()
iSock = CBluetoothSocket::NewL(*this, iSocketServ);
// It is used to Set accept incoming connections,
//which will be handled by the BluetoothNotifier
iListenSock->Accept(*iSock);
According to the reference the call will extracts the first pending connection on the queue of sockets, the queue size before specified by using CBluetoothSocket::Listen(TUint). After the successful completion the blank socket is given the handle for the new socket and it can be used for transfer the data, and after the completer the accept socket is used for making the further connection. Which will be with the new blank sockets. I just want to know what to do now I want to pass the socket to another thread. Finally I want to know how to receive multiple connection using CBluetoothSocket::Accept() multi connection
Bookmarks