ict.helpdesk@btcctb.org
Hello,
We use SmartFTP library STA class in the development environment of Navision Attain (ERP) with ProFTPd server. When a FTP error occurs during login, the process using smart FTP is locked. It seems that the Connect() function of SmartFTP didn't return a value to our application in this case. This error occurs at every login error.
The SmartFTP trace :
[20060328 13:52:07] SmartFTP FTP Library v1.5.6.0
[20060328 13:52:07] Resolving host name "FTPservername"
[20060328 13:52:07] Connecting to 62.72.105.222 Port: 21
[20060328 13:52:07] Connected to FTPservername.
[20060328 13:52:07] Server closed connection
We have used the connection procedure in a loop with a dialog to reproduce and understand more easily the problem. The process only connects and disconnects from the FTP server.
It's a critical issue because:
Our application must download and upload files at every period of time.
We can not see that the process is not responding in a short interval.
This problem locks the application: the users have to kill the task.
That often arrives because we work in a country with low internet bandwidth rate.
When removing the events on the SmartFTP automation (FTPC WithEvent=No), the problem do not seem to occur: the application is not blocked when the server closes the connection during login. This is not an acceptable solution for us. We use SmartFTP to handle event: we made a progress bar with transfer events.
Why the connect() function of SmartFTP library didn
We use SmartFTP library STA class in the development environment of Navision Attain (ERP) with ProFTPd server. When a FTP error occurs during login, the process using smart FTP is locked. It seems that the Connect() function of SmartFTP didn't return a value to our application in this case. This error occurs at every login error.
The SmartFTP trace :
[20060328 13:52:07] SmartFTP FTP Library v1.5.6.0
[20060328 13:52:07] Resolving host name "FTPservername"
[20060328 13:52:07] Connecting to 62.72.105.222 Port: 21
[20060328 13:52:07] Connected to FTPservername.
[20060328 13:52:07] Server closed connection
We have used the connection procedure in a loop with a dialog to reproduce and understand more easily the problem. The process only connects and disconnects from the FTP server.
Global function :
gdialog.OPEN();
UpdateDialog(1,BTC014);
IF (gf_LoadFTPSetup) THEN
BEGIN
WHILE i<1000 DO
BEGIN
gboo_RetValue:=TRUE;
CLEAR(FTPC);
IF gf_Connect THEN
BEGIN
END
ELSE gboo_RetValue:=FALSE;
i:=i+1;
SLEEP(100);
IF NOT(gboo_RetValue) THEN
lf_SaveFTPTrace()
ELSE
BEGIN
IF NOT(lf_DeleteFile(gcu_FolderMgt.gf_RetLocWork(),gtex50_FTPTraceFileName)) THEN
lcu_EventLog.gf_InsertEventCode(2,4,0,'FTP','E-28-020','','','','','','','','','','',FALSE);
END
END
END;
CloseDialog;
gf_Connect() retboo : Boolean
IF NOT(SmartFTPKey()) THEN
BEGIN
lcu_EventLog.gf_InsertEventCode(3,3,0,'FTP','E-28-043','','','','','','','','','','',FALSE);
EXIT(FALSE);
END;
UpdateDialog(1,BTC006);
CREATE(FTPC);
FTPC.Host:=grec_NWDSetup."FTP Server";
FTPC.Username:=grec_NWDSetup."FTP Login";
FTPC.Password:=grec_NWDSetup."FTP Password";
FTPC.Protocol:=0;//normal (not SSL)
FTPC.Passive:=grec_NWDSetup."FTP Passive Mode";
FTPC.DataTransferType:=2; //binary
FTPC.HidePassword(TRUE);
FTPC.LogFile:= gcu_Conv.MakeFilePath(gcu_FolderMgt.gf_RetLocWork(),gtex50_FTPTraceFileName);
IF FTPC.Connect()<>0 THEN
BEGIN
lcu_EventLog.gf_InsertEventCode(3,3,0,'FTP','E-28-005','','','','','',FORMAT(FTPC.LastError()),'','','','',FALSE);
EXIT(FALSE)
END;
IF NOT(gf_CheckStatus) THEN
EXIT(FALSE);
UpdateDialog(1,BTC017); //2005 09 07 - ED - NWD1.RC03;
gf_Disconnect();
EXIT(TRUE);
gf_Disconnect() Retboo : Boolean
UpdateDialog(1,BTC007);
IF (FTPC.Close()<>0) THEN
BEGIN
lcu_EventLog.gf_InsertEventCode(3,3,0,'FTP','E-28-006','','','','','',FORMAT(FTPC.LastError()),'','','','',FALSE);
CLEAR(FTPC);
EXIT(FALSE)
END;
CLEAR(FTPC);
UpdateDialog(1,BTC018);
EXIT(TRUE);
Our application must download and upload files at every period of time.
We can not see that the process is not responding in a short interval.
This problem locks the application: the users have to kill the task.
That often arrives because we work in a country with low internet bandwidth rate.
When removing the events on the SmartFTP automation (FTPC WithEvent=No), the problem do not seem to occur: the application is not blocked when the server closes the connection during login. This is not an acceptable solution for us. We use SmartFTP to handle event: we made a progress bar with transfer events.
Why the connect() function of SmartFTP library didn