xfConnectAndSend

#include <fte.h>

DWORD WINAPI xfConnectAndSend(hSession, lpAddress, lpOpen, lpDescription, lpFiles, lpTag, lcbTag, dwFlags)
HSESSION
hSession; /* handle of session to use for connection */
LPXFRADDRESS
lpAddress; /* pointer to transfer address for connection */
LPCSTR
lpOpen; /* pointer to parameter for receiving application */
LPCSTR
lpDescription; /* pointer to friendly description of transfer */
LPCSTR
lpFiles; /* pointer to list of files to transfer */
LPCSTR
lpTag; /* pointer to arbitrary data for receiving application */
DWORD
dwTag; /* number of bytes in tag */
DWORD
dwFlags; /* flag specifying conditions for send */

The xfConnectAndSend function makes a connection, transfers file(s), and terminates the connection.

Parameters

hSession

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

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.

lpOpen

Indicates the filename to open after the transfer is complete. This parameter is optional, and if not used, set it to NULL. If XF_MATCHID is specified, the applications conducting the transfer determine the meaning of the string.

lpDescription

The single, friendly name to describe a file transfer that involves multiple files. This name can be, for instance, "Budget Update" when transferring multiple files in a budget update. This parameter is optional, and if not used, set it to NULL.

lpFiles

Identifies the file or list of files to send. It contains successive, zero-terminated strings that are the filenames to transfer. The entire list of files ends with an additional zero; that is, two zeros terminate the final filename string. This parameter is optional, and if not used, set it to NULL.

lpTag

Contains optional, additional information to send to the receiving application. It can contain arbitrary, binary information for the receiving application to interpret, and it can be sent even if no file is sent. For example, it can convey the paragraph and sentence to where a receiving word processing application moves its cursor when displaying a transferred file.

dwTag

Length of the tag to send, in bytes.

dwFlags

Specifies conditions for the connection and send. It can be any of these values:

Value

Meaning

XF_DONT_COMPRESS

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

XF_INCLUDEPATH

Include path names along with filenames. If not specified, only filenames are sent.

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 the file transfer is complete before returning from the function call. If not specified, the function returns immediately.


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 the connection and transfer before returning from the call. Otherwise, the call returns immediately, an XF_SUCCESS return value does not necessarily signify a successful operation, and the file transfer engine continues to make the connection and the transfer.

The xfConnectAndSend function call is equivalent to calling the xfConnect, xfSend, and xfDisconnect functions. If the complete list of files is known before making the connection, and if the xfConnect function call is not required, the xfConnectAndSend function can be used instead of the equivalent function sequence.

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

xfConnect, xfDisconnect, xfInitialize, XFRADDRESS, xfSend