Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
13.5k views
in Java FTP by (400 points)
Hi together,

I am new to the forum and need help from the ftp experts from enterprisedt.com.

General:
I am about to finalize the development for an android app, where I used the java ftp library from enterprisedt.com. When the app is finished and working, I will buy the edtFTPj/PRO license for 499 dollar when I release it.
One part of the app is to upload and download a file via ftp and measure the upload and download data rate.

Problem:
The integration worked fine and in general everything works.
BUT whereas the upload speed is in the same range as I can see with reference tests (e.g. via windows laptop and command line ftp tool), the download speed is significant lower.

Example:
UL DL
~1000 KB/s ~600 KB/s (my Android App with Samsung Galaxy S2)
~1000 KB/s ~3000 KB/s (reference tests)

What I tried:
- play arround with buffer size
- do not register an event listener at the ftp library
- do not store the received data to disc (because I thought maybe writing into a file may be the botte neck under android)
- take only the ftp code out of my complex app and build an absolut easy app with only one button to start the download

but all that does not change anything!

What I tried next:
- build an simple java application with exactly the same ftp code used in the easy android app and run it from my window pc
=> the same code reaches the expected download rate!!!
- downloaded a free ftp android app ('AndFTP') from play store and downloaded exactly the same file
=> also this android app reaches the expected download rate!!!

So now I am completely gone! Everything I tried to nail down the problem does not help, and with the fact, that the same code works on a different OS and other ftp apps like 'AndFTP' works well on my android phone, everything makes not sense.

Has anyone an idea, what in general can prevent a ftp download to reach the expected throughput?

Has anyone made same experience using the library under android OS? E.g. maybe the use of threads is somehow not compatible? But why the upload is working fine?

Thanks for any help.

15 Answers

0 votes
by (400 points)
It's sad, but nothing has changed when manipulating these values;-( I had such a good feeling that this could be the problem.

What I now trying to do is to generate a pcap file on the ftp server side, and trying to see with wireshark what a major differences between the use of the two libraries.
0 votes
by (162k points)
Let us know if you want us to look at any logs.
0 votes
by (400 points)
Fortunately I found out what the problem was. It was the fact that the edtFTPj library uses by default 'Active' mode, and I have never thought on change that. But in the logs I have seen that the other library uses 'Passive' mode, so I just add a

_ftp.getAdvancedFTPSettings().setConnectMode(FTPConnectMode.PASV);

and also the download speed was there:-)

I never thought on that, because how the hell can the transfer rate be depending if the client opens the connection initially to server, or other way arround. A colleage of mine explained it to me, telling me something about routing and that packets need to checked by someone (router,firewall) whereas in the other mode not. To be honest, it didn't get that, but there must be something.

Thank you, for your support.

BTW: Shouldn't be the 'Passive' mode be the default in the edtFTPj library? 'Passive' looks like to be standard.
0 votes
by (162k points)
I'm pretty surprised that changing to passive mode made such a difference. We'll make a note of it in our user guide.
0 votes
by
Yes, try dataReceiveBufferSize = dataSendBufferSize = 128*1024 to start with, and then try 512*1024








________________________
wow gold kaufen|diablo 3 gold|gw2 gold|WoW Gold

Categories

...