public void run() {
        if (D) Log.d(TAG, "Socket Type: " + mSocketType +
                "BEGIN mAcceptThread" + this);
        setName("AcceptThread " + mSocketType);

        BluetoothSocket socket = null;

        // Listen to the server socket if we're not connected
        while (true) {
            try {
                // This is a blocking call and will only return on a
                // successful connection or an exception
                socket = mServerSocket.accept();
                
            } catch (IOException e) {
                Log.e(TAG, "Socket Type: " + mSocketType + "accept() failed", e);
                break;
            }

            // If a connection was accepted
            if (socket != null) {
                // handle the new remote device in a ConnectedThread
            	ConnectedThread ct = new ConnectedThread(socket, mSocketType, timeout);
            	ct.addListener(rfcomm);
            	ct.start();
            	if (listener != null) listener.newDeviceConnected(ct);
            }
        }
        if (D) Log.i(TAG, "END mAcceptThread, socket Type: " + mSocketType);

    }