Code example for BluetoothServerSocket

Methods: close

0
  } 
 
  public synchronized void close() { 
    if (serverSocket != null) {
      try { 
        serverSocket.close();
      } catch (IOException e) {
        Log.e(TAG, "Failed to close Bluetooth server socket", e);
      } finally { 
        serverSocket = null;
      } 
    } 
 
    super.close(); 
  } 
 
  public boolean isValid() { 
    /* note: we're not checking MultiPort.isValid(), because we assume 
       the AndroidPort is doing fine even if nobody has connected 
       yet */ 
    return serverSocket != null;