Android Question FTP problem

Claudio57

Member
Licensed User
Longtime User
When I upload files with FTP after a bit of times I get the error "libcore.io.ErrnoException: sendto failed: EPIPE (Broken pipe)".
Why? How do I fix this?
 

Claudio57

Member
Licensed User
Longtime User
Se non ne hai idea puoi anche non rispondere senza continuare a venire a "sporcare" i miei thread. Se scrivo nel forum inglese è perché mi aspetto le risposte da persone competenti e se tu mi rispondi in italiano magari queste persone che non capiscono la nostra lingua pensano che tu mi abbia dato una risposta risolutiva. Ti pregherei dall'astenerti dal rispondere ai miei quesiti se non sai la risposta. Grazie.
 
Upvote 0

Claudio57

Member
Licensed User
Longtime User
#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region

#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region

Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim ftp1 As FTP
End Sub

Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim btn1 As Button
Dim btn2 As Button
Dim btn3 As Button
End Sub

Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("Layout1")
If FirstTime Then
Try
ftp1.Initialize("ftp1", "ftp.********.it",21,"*****@aruba.it", "********")
Catch
Msgbox("Impossibile l'Upload", "messaggio d'errore")
End Try
End If
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub btn1_Click
Risuftp ("Espo0.txt")
End Sub
Sub btn2_Click
Risuftp ("Espo1.txt")
End Sub
Sub btn3_Click
Risuftp ("Espo2.txt")
End Sub
Sub Risuftp(s As String)
Try
ftp1.UploadFile(File.DirDefaultExternal, s, True,"********/dati/" & s)
Catch
Msgbox("Problemi con FTP", "Errore imprevisto" )
End Try
End Sub
Sub ftp1_UploadProgress (ServerPath As String, TotalUploaded As Long, Total As Long)
Dim s As String
s = "Uploaded " & Round(TotalUploaded / 1000) & "KB"
If Total > 0 Then s = s & " out of " & Round(Total / 1000) & "KB"
Log(s)
End Sub

Sub ftp1_UploadCompleted (ServerPath As String, Success As Boolean)
Log(ServerPath & ", Success=" & Success)
If Success = False Then Log(LastException.Message)
End Sub
 
Upvote 0

Claudio57

Member
Licensed User
Longtime User
Ok, sorry Erel. The connection is 3G and it works very well. It works well for some time but after a while time I get the error "libcore.io.ErrnoException: sendto failed: EPIPE (Broken pipe)"
 
Upvote 0
Top