Job Management Partner 1/File Transmission Server/FTP Description, Reference and Operator's Guide
Format
#include <apihead.h> #include <winsock.h> BOOL fts_ftp_asyn_request_ex( SOCKET sock, const char *cardname, FTS_FTP_API_DATA_EX *data, unsigned long *trno, int get_return_flag )
Function
This function registers a transmission request to JP1/FTP, but does not wait for the transmission to terminate. You must use fts_ftp_event_ex()to obtain the termination result. You can define the transmission request by specifying a transmission information structure or the name of a registered transmission card. You can determine whether the transmission was successful by checking the trans_status member of the transmission-end information structure that is obtained by fts_ftp_event_ex().
Arguments
sock
Specifies the return value of fts_ftp_open().
cardname
Specifies the name of a registered transmission card. The file transmission request is registered in accordance with the information on the transmission card.
data
Specifies the address of a transmission information structure.
If NULL is specified in cardname, the file transmission request is registered according to the information specified in data.
If the name of a registered transmission card is specified in cardname, the information on the transmission card is registered.
trno
Specifies the address at which the transmission number is stored.
This matches the transmission number in the transmission-end information that is obtained from log information or by fts_ftp_event_ex().
get_return_flag
If you have specified FTS_GET_RETURN, you can obtain the transmission-end information by calling fts_ftp_event_ex().
If you have specified FTS_UNGET_RETURN, the transmission-end information cannot be obtained.
Notes
- Call this function after you have called fts_ftp_open().
- If you want to obtain transmission-end information, call fts_ftp_event_ex() with FTS_GET_RETURN specified in the fifth argument. In this case, make sure that you issue fts_ftp_event_ex(). If fts_ftp_event_ex() is not issued, you might not be able to release the system resources (memory) because the transmission-end information remains in the process that issued the function or in JP1/FTP.
- If you do not want to obtain termination information, specify FTS_UNGET_RETURN in the fifth argument.
Return values
TRUE Normal FALSE Abnormal.
Registration of transmission request failed.To obtain extended error information, call the WSAGetLastError function. The table below lists and describes the return values for the extended error information. For details about other errors, see the winsock documentation.
Return value of extended error information
(hexadecimal, decimal)Description Can be retried? FTS_API_ERROR_NOTSTARTUP
(0x2FFFFF00, 805306112)WSAStartup() has not been called. No FTS_API_ERROR_DISCONNECT
(0x2FFFFF05, 805306117)A connection with the JP1/File Transmission Server/FTP Client service was released. If you want to register the transmission request again, you must start the process over from ftp_ftp_open(). No FTS_API_ERROR_NOTREADCARD
(0x2FFFFF06, 805306118)The specified card name cannot be referenced.
The card might not have been registered correctly.No FTS_API_ERROR_BADFORMAT
(0x2FFFFF07, 805306119)An address with an invalid data type was specified in an argument. No FTS_API_ERROR_MAXPALTRANS
(0x2FFFFF08, 805306120)The maximum number of concurrent transmissions has been reached.
Register the transmission request after another transmission is finished.Yes FTS_API_ERROR_MEMORY
(0x2FFFFF0B, 805306123)Memory allocation failed. No FTS_API_ERROR_NOTSOCK
(0x2FFFFF0D, 805306125)The return value of fts_ftp_open() might not have been set in the first argument. No FTS_API_ERROR_FTSMISS
(0x2FFFFF0E, 805306126)An error occurred in the JP1/File Transmission Server/FTP Client service. No FTS_API_ERROR_LOGIC
(0x2FFFFF10, 805306128)A logical conflict error occurred in API. No
All Rights Reserved. Copyright (C) 2010, Hitachi, Ltd.