Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.6k views
in Java FTP by (160 points)
Using edtFTP, is it possible to recover from a dropped connection to the server in mid-transfer?

When I yank the internet connection in the midst of an upload, my Java app just seems to hang. It doesn't abort and I don't see an exception that I could catch.

Also, is there at least a timeout I can set? I've tried, setTimeout(), getAdvancedFTPSettings().setRetryCount() and getAdvancedFTPSettings().setRetryDelay() but none of those seem to have any effect.

3 Answers

0 votes
by (162k points)
What timeout value are you setting?
0 votes
by (160 points)
Right now, I'm doing setTimeout(20000), but I've used a range of values, and the bottom line is it doesn't seem to be timing out when the connection drops. The use I'm putting this to is a circumstance where files are often being sent over an aircard, so a dropped connection is extremely common, and the application needs to detect this and recover.
0 votes
by (162k points)
Normally this isn't a problem - you get an exception thrown.

Are you sure a transfer is occurring? The socket read should time out.

Maybe it is worth writing a simple Java socket program to try to see if you can detect the unplug.

Categories

...