# Class RfcommServer

java.lang.Object
com.codename1.bluetooth.classic.RfcommServer

public abstract class RfcommServer extends Object
A listening RFCOMM endpoint (SPP server) registered with the local SDP database via `BluetoothClassic.listen(String, BluetoothUuid, boolean)`.

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `RfcommServer(BluetoothUuid serviceUuid)`
  Constructed by ports; not application API.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract AsyncResource<RfcommConnection>`
  `accept()`
  Resolves with the next incoming `RfcommConnection`.
  `abstract void`
  `close()`
  Stops listening; pending `accept()` calls fail with `BluetoothError.IO_ERROR`.
  `BluetoothUuid`
  `getServiceUuid()`
  The service UUID this server was registered under.

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### RfcommServer

    protected RfcommServer(BluetoothUuid serviceUuid)
    Constructed by ports; not application API.

- ## Method Details

  - ### accept

    public abstract AsyncResource<RfcommConnection> accept()
    Resolves with the next incoming `RfcommConnection`. Call again after each resolution to accept further clients.

  - ### close

    public abstract void close()
    Stops listening; pending `accept()` calls fail with `BluetoothError.IO_ERROR`.

  - ### getServiceUuid

    public BluetoothUuid getServiceUuid()
    The service UUID this server was registered under.