Send Request API
This API issues the Send Request or the Resend Request.
Syntax
INT __stdcall utlrecv( LPCSTR lpszFileID , LPCSTR lpszHostName , BOOL bResend , BOOL bNp , BOOL bSync , INT nWait );
Explanation of the parameters
- LPCSTR lpszFileID (IN)
-
Specify the file ID of the file to receive
Specify the file ID as a character string within 50 bytes. To omit this parameter, specify 'NULL.'
- LPCSTR lpszHostName (IN)
-
Specify the name of the remote host to which you issue a request for the Send processing
Specify the host name as a character string within 68 bytes. To omit this parameter, specify 'NULL.'
For the Resend Request (bResend=TRUE), this parameter is mandatory.
- BOOL bResend (IN)
-
Specify the Resend Request flag
- TRUE:
-
Specify the Resend Request
- FALSE:
-
Specify the Send Request
- BOOL bNp (IN)
-
Specify the Checkpoint flag
For the Send Request (bResend=FALSE), be sure to specify 'FALSE.'
- TRUE:
-
Carry out transfer of the Resend Request from the beginning of the file
- FALSE:
-
Carry out the Checkpoint Resend Request
- BOOL bSync (IN)
-
Specify the synchronous transfer flag
For the Resend Request (bResend = TRUE), you cannot specify Synchronous Transfer.
- TRUE:
-
Carry out Synchronous Transfer
- FALSE:
-
Do not carry out Synchronous Transfer
- INT nWait (IN)
-
Specify the wait time of Synchronous Transfer (in seconds)
When you specify the Synchronous Transfer, set the wait time for synchronizing the transfer with the result of processing, in the range from '10' to '259200.' When it reaches the time that you specified, HULFT resumes processing even if it is in the middle of receiving. In this case, note that HULFT does not return the transfer results.
The parameter is enabled only when the Synchronous Transfer (bSync=TRUE) is specified. When you do not intend to carry out the Synchronous Transfer (bSync=FALSE), specify '0.'
When you specify '0' for this parameter, HULFT applies the set value of Socket Read Timeout (socktime) in the System Environment Settings file (hulenv.cnf).
Note
When you specify 'NULL' for both lpszFileID and lpszHostName, HULFT carries out Resend Request to all hosts.
Returned Value
This function returns '0' if the processing completes successfully. The status when an error occurs is the same as the error code of 'utlrecv.exe.'
For details, refer to Error Codes and Messages.
<Usage example>
Specifying settings when using Visual C++
#include <windows.h> #include <stdio.h> typedef INT (__stdcall *LPUTLRECV)( LPCSTR lpszFileID, LPCSTR lpszHostName, BOOL bResend, BOOL bNp, BOOL bSync, INT nWait); int main() { CHAR szFileID[50+1]; CHAR szHostName[68+1]; BOOL bResend; BOOL bNp; BOOL bSync; INT nWait; HMODULE hHulDll; HMODULE hApiDll; LPUTLRECV lpUtlrecv; INT nStatus; strcpy_s(szFileID, sizeof(szFileID), "TEST0001"); strcpy_s(szHostName, sizeof(szHostName), "host0001"); bResend = FALSE; bNp = FALSE; bSync = TRUE; nWait = 300; hHulDll = LoadLibrary("C:\\HULFT Family\\hulft8\\bin\\hulftrt.dll"); if (hHulDll == NULL) { printf("Unable to load hulftrt.dll." "(Error code=%lu)\n", GetLastError()); return 1; } hApiDll = LoadLibrary("C:\\HULFT Family\\hulft8\\bin\\hulapi.dll"); if (hApiDll == NULL) { printf("Unable to load hulapi.dll." "(Error code=%lu)\n", GetLastError()); FreeLibrary(hHulDll); return 2; } lpUtlrecv = (LPUTLRECV)GetProcAddress(hApiDll, "utlrecv"); if (lpUtlrecv == NULL) { printf("Unable to retrieves the address of HULFT API." "(Error code=%lu)\n", GetLastError()); FreeLibrary(hApiDll); FreeLibrary(hHulDll); return 3; } nStatus = lpUtlrecv(szFileID, szHostName, bResend, bNp, bSync, nWait); if (nStatus == 0) { printf("Terminated normally.\n"); } else { printf("Error occurred when calling HULFT API." "(Returned value=%d)\n", nStatus); } FreeLibrary(hApiDll); FreeLibrary(hHulDll); return 0; }