Android Question Getting java.net.SocketException: Connection reset error

JohnC

Expert
Licensed User
Longtime User
I have an app that does a few FTP actions.

I am using okHTTPutils2 v2.82 and B4A 9.01

B4X:
FTP.List("/images/gallery/")

The above FTP action works fine, so I know the credentials and the connection are ok.

But when I try to create a new directory using a Google Pixel phone running SDK 28, it gives a "java.net.SocketException: Connection reset" error:

B4X:
FTP.SendCommand("MKD","/images/Gallery/" & NewDirName)

It works in the emulator running SDK 28, and on a Nexus running SDK 24 and an S4 running SDK 21.

Since the "MKD" (using ".SendCommand") is a "manually-specified" action (and not a built-in action like .Upload or .List) could this have something to do with this error?
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

MarcoRome

Expert
Licensed User
Longtime User
How are okhttputils and ftp related here?

The command you suggested allows your app to use HTTP connections instead of HTTPS.

I´m not sure about the error though.
Maybe related to passivemode?

Hi dear Don. I answered this way because he also spoke of okHTTPutils2 ( thing different from FTP ). So having no reference code and thinking that somehow you use okHTTPutils2 i suggested trying that solution
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
Upvote 0

JohnC

Expert
Licensed User
Longtime User
Try add in Manifest:

B4X:
CreateResourceFromFile(Macro, Core.NetworkClearText)
That fixed it!

Thanks Marco.

Strange how the SDK 28 Emulator image did not "emulate" this problem.
 
Upvote 0
Top