Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 44781 invoked from network); 13 Jun 2007 19:38:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Jun 2007 19:38:07 -0000 Received: (qmail 61638 invoked by uid 500); 13 Jun 2007 19:37:49 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 61625 invoked by uid 500); 13 Jun 2007 19:37:49 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 29108 invoked by uid 99); 13 Jun 2007 13:20:23 -0000 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=RCVD_NUMERIC_HELO,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Subject: retrieveFile Hangs After Few Hundred Calls From: Youssef Eldakar To: commons-user@jakarta.apache.org Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: Bibliotheca Alexandrina Date: Wed, 13 Jun 2007 16:18:05 +0300 Message-Id: <1181740685.5409.36.camel@zombiebox-y.archive.bibalex.org.archive.bibalex.org> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 X-Virus-Checked: Checked by ClamAV on apache.org I am using FTPClient to download hundreds of files. The source code is below. Each time I run the program, a couple hundred files are retrieved before the retrieveFile method hangs at a random file and never returns. At that point, netstat still shows an ESTABLISHED connection with the server. I am wondering if someone could offer a suggestion on how I could debug this further. I am running JDK 1.5.0_11 on Debian Etch. -- import java.io.*; import java.lang.*; import org.apache.commons.net.ftp.*; public class ftpget { public static void main(String[] args) { try { FTPClient ftp = new FTPClient(); ftp.connect(...); ftp.login(...); ftp.setFileType(ftp.IMAGE_FILE_TYPE); ftp.changeWorkingDirectory(...); FTPFile[] files = ftp.listFiles(); for(int i = 0; i < files.length; i++) { if(files[i].isFile()) { FileOutputStream os = new FileOutputStream(files[i].getName()); ftp.retrieveFile(files[i].getName(), os); os.close(); } } ftp.logout(); ftp.disconnect(); } catch(Exception e) { ... } } } -- Youssef Eldakar Bibliotheca Alexandrina --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org