title: WinCE: 10053 error during connect
body: <p>I wrote a Bluetooth client program for a wince 4.2 device. The device discovery works fine. However, when I attempt to connect to a PC, the connect function immediately returns with error code <code>10053</code>. The connection request was being processed by the PC with a prompt to enter the authentication code but the wince device doesn’t seem to wait.</p>
  
  <p>What could be causing this issue? I am using the following steps (removed error handling for simplicity):</p>
  
  <pre><code>WSAStartup(..)…////was successful.
  
  SOCKET m_Socket =Socket (AF_BTH, SOCK_STREAM, BTHPROTO_RFCOMM); //was successful.
  
  SOCKADDR_BTH sClinet;
  memset (&amp;sClinet, 0, sizeof(sClinet));
  sClinet.addressFamily = AF_BTH;
  sClinet.btAddr = btd.btaddr; ; //BT_ADDR of the PC obtained via Device Discovery..
  sClinet.port = BT_PORT_ANY; //I did try 0, did not help!
  sClinet.serviceClassId = RFCOMM_PROTOCOL_UUID; 
  
  int nConErr = connect (m_Socket, (SOCKADDR *)&amp;sClinet, sizeof(sClinet));
  </code></pre>
  
  <p><code>nConErr</code> returns <code>10053</code> immediately. It doesn’t even wait, even though the PC recognized the connection and prompted a message to enter the PIN for authentication.</p>