Tuesday, January 26, 2010

[android-developers] Android 2.0.1 SocketTimeoutException received with FTP Data channel

Hello,

I am using android 2.0.1 in both the SDK emulator and non-rooted moto
droid. Both have the same problem that affects multiple FTP clients
when trying to open an FTP data channel.

The first data connection that is opened by the client (usually a
LIST) will hang. NETSTAT from the emulator and from the server shows
the TCP port 50000 is established, and remains established, but "hung"
and does not tear-down properly.

runFTP client will give the follwing error message:
java.net.SocketTimeoutException: The operation timed out

not all FTP clients will give an error message but the ones that do,
show something similar.

My connection setup is unique, I use an SSH2 server and client to
establish secure communications and then forward TCP ports between the
client platform (droid) and my network. This serves as a very good
"road warrior" setup when I'm on my laptop, I have had no problems
there.

The droid and the emulator from the android SDK both hang at the first
data connection established after I log on to the the FTP server.

The FTP control connection is properly established through the TCP
port forwarding and it remains connected throughout the session.

FTP-Data will only work in passive mode due to the port forwarding,
and the FTP server is restricted to only request port connections on
TCP 50000 from the client.

The logcat from the emulator shows the following at the time of the
failed directory "list"

01-18 12:18:49.218: INFO/global(7788): Default buffer size used in
BufferedReader constructor. It would be better to be explicit if an 8k-
char buffer is required.
01-18 12:18:49.632: INFO/global(7788): Default buffer size used in
BufferedInputStream constructor. It would be better to be explicit if
an 8k buffer is required.

or

01-18 12:16:17.186: INFO/global(7788): Default buffer size used in
BufferedInputStream constructor. It would be better to be explicit if
an 8k buffer is required.
01-18 12:16:17.186: INFO/global(7788): Default buffer size used in
BufferedOutputStream constructor. It would be better to be explicit if
an 8k buffer is required.

The actual logcat messages vary, there are usually garbage collection
events and these different buffer messages, but there is no solid
"yes, this failed" message presented in logcat even when I used a
debug version of AndFTP in the emulator.

The only solid evidence of an exception is the runFTP message (and
similar from other clients) I discussed above. I would assume that
the problem is with the Java VM, not with any given client, but I
cannot confirm that.

The server (ProFTPD) is in debug mode and the logs don't show any
clues there either.

The problem does not occur when connecting natively, without SSH port
forwarding, and I have not yet tried it with non-encrypted port
forwarding as I do not have the SDK installed on my SSH server. If
you could give some hints as to how to set up remote port forwarding
with the SDK, I would like to try that.

I am using Connectbot 1.6.1 as my SSH2 client and to establish the TCP
tunnels. Is there another similarly featured client I can test with?

Is there a linux native FTP app compiled for the emulator that I can
try? I noticed that busybox doesn't have FTP in it??

Any other suggestions or help you can give would be appreciated.

Thank you in advance!
--James

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate