Code example for BluetoothServerSocket

Methods: close

1
        } 
 
        public void cancel() { 
            if (D) Log.d(TAG, "Socket Type" + mSocketType + "cancel " + this);
            try { 
                mmServerSocket.close();
            } catch (IOException e) {
                Log.e(TAG, "Socket Type" + mSocketType + "close() of server failed", e);
            } 
        } 
    } 
 
 
    /** 
     * This thread runs while attempting to make an outgoing connection 
     * with a device. It runs straight through; the connection either 
     * succeeds or fails. 
     */ 
    private class ConnectThread extends Thread {
        private final BluetoothSocket mmSocket;
        private final BluetoothDevice mmDevice;