Bug? FTP and NetExtras

David Hawkins

Active Member
Licensed User
Longtime User
Hi guys and girls

I have experienced the following error with FTP when using the netextras library (v1.202) 'java.lang.Exception: Sub ftp_listcompleted signature does not match expected signature', if I continue the file upload and file download sub routines work fine. When I remove the netextras library I no longer get the error message.

Attached is the zip file for the project and the screen shot of the error message.

I am using B4A version 3.21, Net library 1.37 and my tablet is a Samsung Galaxy Note 10.1

Question is can anybody shed any light on the problem

Many Regards

David
 

Attachments

  • testftp.zip
    6.1 KB · Views: 243
  • Screenshot_2014-03-02-12-32-08.png
    Screenshot_2014-03-02-12-32-08.png
    46.6 KB · Views: 220

DonManfred

Expert
Licensed User
Longtime User
When you use netextras you have to use ftpresume instead of FTP

wrong
B4X:
dim ftp as ftp

right
B4X:
dim ftp as ftpresume

Instead of DownloadFile you have to use DownloadFileResume and instead UploadFile you have to use UploadFileResume (note that this has one more parameter)

But your code works as expected when using the right object ;)

See NetExtras.html from NetExtras_v1.202.zip
 

David Hawkins

Active Member
Licensed User
Longtime User
When you use netextras you have to use ftpresume instead of FTP

wrong
B4X:
dim ftp as ftp

right
B4X:
dim ftp as ftpresume

Instead of DownloadFile you have to use DownloadFileResume and instead UploadFile you have to use UploadFileResume (note that this has one more parameter)

But your code works as expected when using the right object ;)

See NetExtras.html from NetExtras_v1.202.zip
Hi DonManfred

Thank you that has resolved the problem

Regards

David
 

Mikonios

Active Member
Licensed User
Longtime User
I'am afraid :: NetExtras(version: 1.52) is not compatible with Net(version: 1.53) same time.
and is imposible catch error !!!

B4X:
Sub FTP_ListCompleted(ServerPath As String, Success As Boolean, Folders() As FTPEntry, Files() As FTPEntry)

' NetExtras(version: 1.52) is not compatible with Net(version: 1.53)
' java.lang.exception ftp_listcompleted signature not match expected signature

'    Csr.LogMemory1("   FTP_ListCompleted: Traza 1", "3")
    Log(ServerPath)

    If Success = True Then

'        Csr.LogMemory1("   FTP_ListCompleted: Traza 2", "3")
        For i = 0 To Files.Length - 1
       
'            Csr.LogMemory1("   FTP_ListCompleted: Traza 3", "3")
            If (Files.Length - 1) > NroMaxFiles AND _
                (Files.Length - NroMaxFiles - i) > 0 AND _
                Files(i).Name.Contains("cocogasdta") Then
          
                Try
                    FTP1.DeleteFile(DirFtp & Files(i).Name)
                    Log("*D*" & Files(i).Name)
                    Csr.LogMemory1("   FTP_ListCompleted: " & "*D*" & Files(i).Name, "3")
                Catch
          
                    Csr.LogMemory1("   FTP_ListCompletedErr: " & Files(i).Name, "3")
                    If LastException.IsInitialized Then
                        Csr.LogMemory(Activity, "LastException. " & LastException, "3")
                        Csr.LogMemory(Activity, "LastException.Message " & LastException.Message, "3")
                    Else
                    End If
              
                End Try
              
            Else
'                Csr.LogMemory1("   FTP_ListCompleted: Traza 4", "3")
                Log(Files(i).Name)
                Csr.LogMemory1("   FTP_ListCompleted: " & Files(i).Name, "3")
            End If
        
        Next
  
        Csr.LogMemory1("   FTP_ListCompleted: NroMax & DirFtp:: " & NroMaxFiles & " " & DirFtp, "3")
        X02_SendFtpBBDD(Main.DirTmp)
  
    Else
        If LastException.IsInitialized Then
            'Other IP:::     android.system.ErrnoException: connect failed: EHOSTUNREACH (No route to host)
            'Other Pto::    android.system.ErrnoException: connect failed: ECONNREFUSED (Connection refused)
            'FromInToOut::    java.io.IOException: Host attempting data connection 192.168.1.114 is not same as server xxx.xxx.54.35
            Log(LastException.Message)
             X55_SndMyFtpSale("    FTP_ListCompletedErr " & LastException.Message)
        Else
             X55_SndMyFtpSale("    FTP_ListCompletedErr NoControlado")
        End If
    End If
End Sub
 
Last edited:
Top