Home > Language Reference > Classes > StreamExg
Connect Method
Establishes a connection with a remote handheld device.
Syntax
Public Sub Connect(ByRef sFilename As String)
| Parameter | Description |
| sFilename | Filename to transmit. |
Remarks
The Connect method establishes a connection with a remote handheld device using the Palm OS® Exchange Manager. You must call this method before being able to write data in an exchange stream.
The sFilename parameter indicates the transmitted filename. The extension is significant: it allows a remote system to know which application to direct the received data. Refer to the documentation on the RegisterExtension method for further information.
The sFilename parameter can optionally include an URL scheme to tell the system which transport library to use to send data. Depending on the selected transport library, it can also contain some specific parameters. The following table shows some common examples:
| URL | Description |
| _beam:filename | Sends the data using the IR Library. |
| _send;_beam:filename | Opens a dialog box that lists all exchange libraries, and allows the user to pick one. |
| _btobex://?_single/filename | Performs a Bluetooth device inquiry, allows the user to choose only one device, and sends the data to that devices. |
| _btobex://?_multi/filename | Performs a Bluetooth device inquiry, allows the user to choose one or more devices, and sends the data to all the selected devices. |
| _btobex://xx.xx.xx.xx.xx.xx/filename | Sends the data to the device whose Bluetooth address is specified. |
The Disconnect method should be called to close the stream when all the requested data has been written; it is only at this moment that the data is effectively transmitted to the remote handheld device.
The help page for the StreamExg object gives a brief example for using this method. You can also refer to the Autograph and MiniLauncher samples.
System requirements
| System | Minimal version | Remarks |
| Palm OS | Palm OS 3.0 | N/A |