xfConnect

#include <fte.h>

DWORD WINAPI xfConnect(lphConnection, hSession, lpAddress, dwFlags)
LPHCONNECTION lphConnection; /* pointer to handle of resulting connection */
HSESSION
hSession; /* handle of session to use for connection */
LPXFRADDRESS
lpAddress; /* pointer to transfer address for connection */
DWORD
dwFlags; /* flag specifying conditions for connection */

The xfConnect function opens a connection using the specified session and address and sets a connection handle.

Parameters

lphConnection

Identifies the resulting connection. If NULL, the connection failed.

hSession

Identifies the desired session, which a call to xfInitialize established.

lpAddress

Provides information (such as a telephone number or a machine name) needed about the transfer address to make the connection. See XFRADDRESS for details about the address structure.

dwFlags

Specifies optional conditions for the connection. It can be one, or a logical or, of these values:

Value

Meaning

XF_DONT_COMPRESS

Don't compress files when transferring them. If not specified, files are compressed for efficient transfer.

XF_MATCHID

Allow only the specific application with the UUID in the uuidAppID field of the XFRADDRESS to receive the files.

XF_WAIT

Wait until connection is made and verified before returning from the function call. If not specified, return immediately after requesting the connection.


Return Value

The return value specifies the result of the termination request. It can be any one of the values list in section 2.2.4. File Transfer Errors.

Comments

If the XF_WAIT flag is specified, the file transfer engine makes and verifies the connection before returning from the call. Otherwise, the call returns immediately. In this case, an XF_SUCCESS return value does not necessarily signify a successful operation, and the file transfer engine continues to complete the connection.

After making a successful xfConnect function call, multiple xfSend function calls can be made to send files using the connection. This capability facilitates transferring files when a complete list of files is not initially available.

Call the xfDisconnect function when you no longer need the connection.

If no UUID is specified in the uuidAppID field fo XFRADDRESS, the default application receives the files. If a UUID is specified, the files will be received by the application or by the default application if the application is not available. If a UUID is specified and the XF_MATCHID option is used, the files must be received by the specific application or the transfer fails.

See Also

xfConnectAndSend, xfDisconnect, xfInitialize, XFRADDRESS, xfSend