Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
21.2k views
in Java FTP by (180 points)
I am using the following code:
if( ! asciiType ) 
            m_client.setType( FTPTransferType.BINARY );
        else
            m_client.setType( FTPTransferType.ASCII );
        
        
        if(usePassive)
            m_client.setConnectMode( FTPConnectMode.PASV );
        else
            m_client.setConnectMode( FTPConnectMode.ACTIVE);
        
        m_client.put( file.getCanonicalPath(), remoteName );

Everything seems to work fine until I tried connecting to an FTP server over the internet. I can retrieve and put files on the server for a while, then suddenly it just hangs. It is not the local file as it happens on different files. I cannot seem to find any consistancy.

The server throws a 553 data transfer failed error, yet the client still sits there.

I have a timeout of 15000 on the socket, and it doesnt timeout either. I left it running for 5 minutes without a timeout exception.

This is happening on Windows XP running JDK 1.4.2-b28, edtftpj-1.4.5.

Thanks!

21 Answers

0 votes
by (161k points)
sorry for the delayed reply, we've been busy.

unfortunately the timeout value is for reading data from the socket (i.e. downloads), not writing to the socket (uploads). This is a function of the Java API, not our implementation - see setSoTimeout.

at some point we'll look at moving to the async socket API, which is a bit more flexible in this area.

Categories

...