System.Bluetooth.TBluetoothServerSocket.Accept

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function Accept(Timeout: Cardinal = 0): TBluetoothSocket;

C++

TBluetoothSocket* __fastcall Accept(unsigned Timeout = (unsigned)(0x0));

Properties

Type Visibility Source Unit Parent
function public
System.Bluetooth.pas
System.Bluetooth.hpp
System.Bluetooth TBluetoothServerSocket

Description

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 Accept on its server socket that represents the service that receives the connection request.

Accept returns a socket that you can use to send and receive data from the remote device that requested the connection. If Accept times out, Accept returns nil.

Timeout is the number of milliseconds before Accept times out. Use -1 to disable the timeout, so that Accept does not return until there is a connection, no matter how long it takes. Use 0 (default) if you do not want Accept to wait.

See Also