• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 261
  • Last Modified:

Any Solution to FTP Client's Weird Behavior?

I have a question regarding FTP Timeout.

During FTP session, if some problems has happened within the IP network,
and if such problems has lasted for a certain duration of time,
FTP server (ftpd) close the session, however it SEEMS that FTP client
 (ftp) has no way to detect that the session is out of service UNTIL
FTP client tries another command after the network has been recovered.
As far as we have examined, before the network is recovered,
FTP client even needs to be killed by hand.

From the point of TCP/IP protocol, both TCP server and client is able
 to detect how long any packets has not been transmitted during its
TCP session and then to close the session if no transmission is
done for a duration of time, which was specified by Time-out parameter.
It seems extremely weird that FTP client has no way to close the
session at its own convenience.

I would like to know the way to make FTP client CLOSE the session
 or to make FTP find the fact that the concerned file transmission
 has failed.  Anybody can help me out?  Await for your response!
0
guo
Asked:
guo
1 Solution
 
atheneycCommented:

Try the passive mode of FTP.
Since the data session (port 20) of ftp is initiated from the server, so the client needs to time-out rather than giving up when the server disappeared on the network.
The passive mode (hopefully supported by yours) gets around this because the data session is also initiated from the client. This mode is also used when setting up packet filtering in firewall.
0
 
vkg063097Commented:

Use hash command in ftp. This will print # for each 4096 byte
it receive from the server or viceversa.
0
 
mrauschCommented:
If you have the means to recompile your FTP client, try setting
the socket option SO_KEEPALIVE on the FTP control connections;
see the manual page to the syscall setsockopt() on your unix
system for more information. The client sets some socket options
on his connections anyway, so with a little knowledge of C it should be no problem to do this.
This will send keep-alive packets on the TCP connection (a bit like ICMP pings), and the OS on the client side will care about
the remote not answering anymore, and thus shutting down the connection.

0
 
guoAuthor Commented:
Thanks for your answer.
We are planning to use Solaris 2.6. Would you please tell me whether Soloris supports passive ftp, how to confirm and how to use it?

0
 
atheneycCommented:
Unfortunately, the ftp on my Solaris 2.6 does not support passive mode. To check yours, simply type ftp. Then in the ">" prompt, type "?" to see if there is any "passive" command show up.

Normally, I don't find any ftp bundled with the original OS (e.g. AIX 3.2.5, SCO, Solaris 2.5.1/2.6, IRIS, Windows 95, etc.) supporting passive mode ftp EXCEPT Linux!!

Therefore, you may download one and comply by yourself. Try the following URL:

http://hobbes.cdrom.com/pub/linux/tsx-11/packages/net/telnet+ftp/

and choose the wu-ftp-2.4-fixed.tar.gz

You may search other site for the wu-ftp and you may probably find a pre-complied Solaris 2.6 package. However, I prefer to comply by myself.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now