B4J Question Convert a b4a app to b4j

davelew1s

Active Member
Licensed User
Longtime User
Hi!
I recently found this https://www.b4x.com/android/forum/threads/tiny-ftp-server-as-class.27369/ which works well, but i am trying to convert the code to b4j to run on a PC. I made a start but quickly ran into an error which at the moment can't cure. So my question is .. before i get too far into the project can anyone tell me if it is possible to convert the original code or am i wasting my time.

Any help or advice will be appreciated t
 

davelew1s

Active Member
Licensed User
Longtime User
Hi Erel thanks for the reply here is the error and the code that causes it.

B4X:
Sub CloseDataSoc
Log("CloseDataSoc")  
  DataSoc.opn = False
If (DataSoc.ist.IsInitialized) Then DataSoc.ist.close ****** error on this line

If (DataSoc.ost.IsInitialized) Then DataSoc.ost.close

  DataSoc.con.close

  If (DataSoc.fist.IsInitialized = True) Then DataSoc.fist.close
  If (DataSoc.fost.IsInitialized = True) Then DataSoc.fost.close
    
End Sub

The first part of the if is true the error occurs in the Then part.

CloseDataSoc
java.net.SocketException: Socket closed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:170)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at java.net.SocketInputStream.read(SocketInputStream.java:127)
at anywheresoftware.b4a.randomaccessfile.AsyncStreams$AIN.run(AsyncStreams.java:184)
at java.lang.Thread.run(Thread.java:745)
ADataStm error: java.net.SocketException: Socket closed
CloseDataSoc

Thanks Dave.
This happens when I try to logon using:-

192.168.1.71:54022/
 
Last edited:
Upvote 0

davelew1s

Active Member
Licensed User
Longtime User
Thanks Erel knowing that I pushed on and it seems to be working ok, but I need to test all parts yet.
 
Upvote 0
Top