2)If so,what is the optimum timeout value i need to set for setsotimeout() ?
Please find stack trace below:
at java.net.SocketInputStream.socketRead0(Native Method)
I'm a person who decided it would be a good idea to put a timeout on the FTP control connection. (I forget why I decided it was a good idea.) It wasn't long before I started getting reports that file uploads were being cancelled, and when I investigated I found that if the file upload took longer than the timeout interval I had specified for the control connection, an timeout exception was thrown and the upload was indeed cancelled. So that timeout interval prevented large files from being uploaded.
What I'm trying to say here is that you should really look for a different solution for your problem.
Joined: Oct 02, 2013
Thanks for your reply.
I was referring to read timeout not connection timeout on FTP control channel.
Coming to the problem you stated,we can make sure control connection is not idle for too long by sending ftp NOOP commands on frequent interval while upload/download is in progress on ftp data connection so that control connection does not times out.
But my current issue is when ftp control connection sends FTP control command 'PASV' on control channel for opening data connection ,ftp server does not reply and thus ftp client keeps waiting indefnitely for ftp server response on ftp control channel and it results in hang.
The same issue on ftp data chaanel can be overcommed by using setDataTimeout().
I want to overcome this issue on control channel,so i was asking whether setting setsotimeout() after connecting to ftp server will help to overcome this issue and also needed optimum timeout value to be used ?