System.Bluetooth.TBluetoothServerSocket.DoAccept
Delphi
function DoAccept(Timeout: Cardinal): TBluetoothSocket; virtual; abstract;
C++
virtual TBluetoothSocket* __fastcall DoAccept(unsigned Timeout) = 0 ;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | protected | System.Bluetooth.pas System.Bluetooth.hpp |
System.Bluetooth | TBluetoothServerSocket |
Description
- Note: This is an abstract method that platform-specific subclasses of TBluetoothServerSocket implement.
Blocks the execution of your application until a connection requested by a remote device is established or until the specified timeout passes, and returns a socket if successful or nil otherwise.
For two Classic Bluetooth devices to establish a connection to each other, one of the devices must request to connect to a service that the other device published, and the other device, in anticipation of this request, must call DoAccept on its server socket that represents the service that receives the connection request.
DoAccept returns a socket that you can use to send and receive data from the remote device that requested the connection. If DoAccept times out, DoAccept returns nil.
Timeout
is the number of milliseconds before DoAccept times out. Use 0 to disable the timeout, so that DoAccept does not return until there is a connection, no matter how long it takes.