Home > Language Reference > Classes > StreamBluetooth

ConnectRequest Event

Event raised when a remote device performs a connection request.

Syntax

Public Event ConnectRequest(ByVal dfAddr As Double, ByRef bAccept As Boolean)

ParameterDescription
dfAddrAddress of the remote device requesting an inbound connection.
bAcceptIndicates whether to reject the inbound connection or not.

Remarks

The ConnectRequest event is raised by a listening socket when a remote device performs a connection request. It gives a chance to your application to accept or reject the request. Processing this event is optional. By default, all connection requests are accepted.

The dfAddr parameter is the Bluetooth address of the remote device. Note that unless your application maintains a cache with device names, you cannot retrieve the friendly name of the device corresponding to this address, since the RemoteDeviceName method is asynchronous.

The bAccept parameter indicates whether to accept or reject the connection once your event handler yields control to the system. By default, it is set to True. To reject the connection, simply set this parameter to False in your event handler.

Note that this event can only be raised by a StreamBluetooth object behaving as a server, ie initialized by a call to the RfCommListen or the L2CapListen methods.

The StreamBluetooth page shows a typical implementation for this event.

System requirements

SystemMinimal versionRemarks
Palm OSPalm OS 5.0Requires a Bluetooth enabled device.