Interface BluetoothServerSocket


  • public interface BluetoothServerSocket
    A Bluetooth server socket is used to provide a service on the local Bluetooth device to other devices.
    • Method Detail

      • accept

        BluetoothSocket accept()
                        throws IOException
        Waits for a remote Bluetooth device to connect to this server socket. This method blocks until a remote device connects. Then it returns a Bluetooth socket that can be used to communicate with the remote device. This method waits for indefinite time.
        Returns:
        the Bluetooth socket
        Throws:
        IOException - if an error occurs while waiting
      • accept

        BluetoothSocket accept​(int timeout)
                        throws IOException
        Waits for a remote Bluetooth device to connect to this server socket. This method blocks until a remote device connects. Then it returns a Bluetooth socket that can be used to communicate with the remote device. This method waits no longer than the specified timeout.
        Parameters:
        timeout - the timeout in seconds
        Returns:
        the Bluetooth socket
        Throws:
        IOException - if an error occurs while waiting
      • close

        void close()
        Closes this server socket.