Android Question Samba Error || (TransportException) jcifs.util.transport.Transpor

Tayfur

Well-Known Member
Licensed User
Longtime User
I want to download image from server PC and show it
I have two way for download (SMB1.DownloadFile /// SMB1.DownloadFile2)
image location
"192.168.1.222/TEKNIK_RESIM/TRELLEBORG/500923841-F.jpg"

I try with samsungS2 4.0.3. it no problem. (40-45sec max downloading time for 1-2mb)
I try with XXX tablet 4.1.1. it dont download image file sometimes.
I am waiting long time or short timeafter I recive problems.(TransportException).
it is doing some times. And I loading "Wifi fixer". So Problem repeat again.

Note: I try with ES3 on XXx tablet (4.1.1). its work and more speed from my code.
I saw ES3 using "smb://...." for downloading process.


hata1.jpg


I have same error.
the remaining files copied over at 0KB with exception:
(TransportException) jcifs.util.transport.TransportException: Transport1 timedout waiting for response to SmbComReadAndX[command=SMB_COM_READ_ANDX,received=false,errorC[/B]


B4X:
#Region  Project Attributes
    #ApplicationLabel: SAMAB Download 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 SMB1 As SMB
    Dim Timer1 As Timer
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.

    Private ImageView1 As ImageView
    Private Button1 As Button
    Private Button2 As Button
    Private Button4 As Button
    Private Button3 As Button
    Private cout As CountingOutputStream
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("1")
    'If FirstTime Then

    SMB1.SetCredentials("tayfur","123456","")'///
    SMB1.Initialize("SMB1")
    SMB1.Initialize("SMB1")
   
    'End If
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub SMB1_DownloadCompleted (Url As String, RemoteFile As String, Success As Boolean)

    ProgressDialogHide
    If Success Then
        ImageView1.Bitmap=LoadBitmap(File.DirRootExternal,"resim1.jpg")
        Msgbox("ok indi","tamam")
    Else
        Msgbox("hata"&CRLF& Success &CRLF &Url &" - "&RemoteFile,"tamam")
    End If
    'cout.Flush
    Timer1.Enabled = False
End Sub


Sub Button2_Click
    SMB1.SetCredentials("tayfur","12345","")'///
    SMB1.Initialize("SMB1")
    SMB1.DownloadFile("smb://192.168.1.222/TEKNIK_RESIM/TRELLEBORG/" ,"500977020D.jpg", File.DirRootExternal,"resim1.jpg") '**** çalışıyor
    ProgressDialogShow("smb://192.168.1.222/TEKNIK_RESIM/TRELLEBORG/" &"500977020D.jpg")
End Sub


Sub Button3_Click

    Timer1.Initialize("SMBTimer",1000)
    Dim out As OutputStream

'    SMB1.SetCredentials("tayfur","12345","")'///
'    SMB1.Initialize("SMB1")
'    SMB1.DownloadFile("smb://192.168.1.222/TEKNIK_RESIM/TRELLEBORG/" ,"500977020D.jpg", out, True)
'
      out.InitializeToBytesArray(0)
    out = File.OpenOutput(File.DirRootExternal, "resim1.jpg", False)
      Timer1.Initialize("SMBTimer",200)
    cout.Initialize(out)
    SMB1.SetCredentials("tayfur","12345","")'///
    SMB1.Initialize("SMB1")

    SMB1.DownloadFile2 ("smb://192.168.1.222/TEKNIK_RESIM/TRELLEBORG/" ,"500923841-F.jpg", cout, True)


    cout.Initialize(out)
    Timer1.Enabled = True
    ProgressDialogShow("smb://192.168.1.222/TEKNIK_RESIM/TRELLEBORG/" &"500923841-F")
End Sub


Sub SMBTimer_Tick
    Button3.Text=(cout.Count)
End Sub
 
Last edited:
Top