fts_ftp_open_ex() - establish connection with JP1/FTP
- Organization of this page
Format
#include <winsock2.h> #include <apihead.h> SOCKET fts_ftp_open_ex( FTS_FTP_API_CONN_DATA *condata )
Function
This function establishes connection with the JP1/File Transmission Server/FTP Client service.
Arguments
condata
Specifies the address of the connection information structure. JP1/FTP connects to the JP1/FTP Client service according to the connection information.
Notes
-
Call this function before you call fts_ftp_syn_request_ex(), fts_ftp_asyn_request_ex(), and fts_ftp_close().
-
This function's return value is needed when you use other functions.
-
If you wish to obtain the extended error information, do not call any function before you call the WSAGetLastError function. If you call another function before the WSAGetLastError function, the information might be lost.
Return values
Socket handler |
Normal |
INVALID_SOCKET |
Abnormal |
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 MSDN 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_UNDEFFTSHOST (0x2FFFFF01, 805306113) |
The specified host name is not defined in the HOSTS file. |
No |
FTS_API_ERROR_CONNREFUSED (0x2FFFFF02, 805306114) |
A connection request was rejected. The JP1/File Transmission Server/FTP Client service might not have been started. |
No |
FTS_API_ERROR_TIMEOUT (0x2FFFFF03, 805306115) |
A connection request to the JP1/File Transmission Server/FTP Client service resulted in a timeout. Connection processing in the JP1/File Transmission Server/FTP Client service might be taking too long or the system on which the JP1/File Transmission Server/FTP Client service is supposed to be running might be down. |
Yes |
FTS_API_ERROR_UNREACH (0x2FFFFF04, 805306116) |
Routing to the host on which the JP1/File Transmission Server/FTP Client service is running might have failed. |
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 fts_ftp_open_ex(). |
No |
FTS_API_ERROR_MEMORY (0x2FFFFF0B, 805306123) |
Memory allocation failed. |
No |
FTS_API_ERROR_UNDEFFTSSERV (0x2FFFFF0C, 805306124) |
The definition of the JP1/File Transmission Server/FTP Client (ftsc) is missing in the SERVICES file. |
No |
FTS_API_ERROR_MAXCONNECT (0x2FFFFF0F, 805306127) |
The permitted maximum number (64) of concurrent connections (issuances of fts_ftp_open_ex()) has been reached. No more connections can be established until another API releases connection (issues fts_ftp_close()). |
Yes |