Return-Path: X-Original-To: apmail-commons-user-archive@www.apache.org Delivered-To: apmail-commons-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 24391D824 for ; Thu, 26 Jul 2012 19:52:39 +0000 (UTC) Received: (qmail 25563 invoked by uid 500); 26 Jul 2012 19:52:36 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 25449 invoked by uid 500); 26 Jul 2012 19:52:35 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 25336 invoked by uid 99); 26 Jul 2012 19:52:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Jul 2012 19:52:35 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FSL_RCVD_USER,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gregor.schmidt@utanet.at designates 213.90.36.46 as permitted sender) Received: from [213.90.36.46] (HELO tatiana.utanet.at) (213.90.36.46) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Jul 2012 19:52:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=utanet.at; s=rev1; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Date:Subject:In-Reply-To:References:To:From:Message-ID; bh=Y++1Cwsy2szv5YSTdQNFp5gCC6x4irtV+AriftbCkGE=; b=X2+djwX/HlHB4yHefc6OdQTBUFiLBrA2zkqpalPtMZFOJwYmK9V/2ARRFUCtBzsxtQVSBYTmXMovzN5hQOUKgstdZk8uQWsLp5+3fYxBCTYJseWMkCHMUMkkjyXacZu7wPSZ5FaBd8ikyKY0L6Qi3bNrVj3+Ui7qC1UK1K+s1Us=; Received: from pam.xoc.tele2net.at ([213.90.36.6]) by tatiana.utanet.at with esmtp (Exim 4.80) (envelope-from ) id 1SuU6Q-0005Wi-Uq for user@commons.apache.org; Thu, 26 Jul 2012 21:52:06 +0200 Received: from [213.162.68.213] (helo=slinePC) by pam.xoc.tele2net.at with esmtpa (Exim 4.80) (envelope-from ) id 1SuU6Q-0002Rs-Io for user@commons.apache.org; Thu, 26 Jul 2012 21:52:06 +0200 Message-ID: <21639816880D4A4ABBE17519D91D8A50@slinePC> From: "Gregor Schmidt" To: "Commons Users List" References: In-Reply-To: Subject: Re: [net] FTP client fails if a modem connection is used Date: Thu, 26 Jul 2012 21:52:04 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 15.4.3555.308 X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3555.308 X-Virus-Checked: Checked by ClamAV on apache.org Hello, These are the faults I found with a low bitrate channel: 1. Upload of a file to the server Line 590 input = new FileInputStream(pathFilename); Line 591 result = ftpC.storeFile(serverFilename, input); An exception is thrown with line 591 and caught by this catch block: catch(SocketTimeoutException ste) { text1 = ste.getMessage(); text2 = ste.getCause(); ste.printStackTrace(); } text1 = Read timed out text2 = null printStackTrace(): java.net.SocketTimeoutException: Read timed out at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(Unknown Source) at sun.nio.cs.StreamDecoder.readBytes(Unknown Source) at sun.nio.cs.StreamDecoder.implRead(Unknown Source) at sun.nio.cs.StreamDecoder.read(Unknown Source) at java.io.InputStreamReader.read(Unknown Source) at java.io.BufferedReader.fill(Unknown Source) at java.io.BufferedReader.read(Unknown Source) at org.apache.commons.net.io.CRLFLineReader.readLine(CRLFLineReader.java:58) at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:310) at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:290) at org.apache.commons.net.ftp.FTP.getReply(FTP.java:632) at org.apache.commons.net.ftp.FTPClient.completePendingCommand(FTPClient.java:1561) at org.apache.commons.net.ftp.FTPClient.__storeFile(FTPClient.java:581) at org.apache.commons.net.ftp.FTPClient.storeFile(FTPClient.java:1704) at InternetServer.putServerFiles(InternetServer.java:591) 2. Download of a file from the server: Line 510 output = new FileOutputStream(pathFilename); Line 511 result = ftpC.retrieveFile(serverFilename, output); The method retrieveFile() returns false, no exception is thrown. 3. Logout from the server Line 218 ftpC.logout(); An exception is thrown with line 218 and caught by this catch block: catch(IOException ioe) { ioe.printStackTrace(); } printStackTrace(): java.net.SocketTimeoutException: Read timed out at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(Unknown Source) at sun.nio.cs.StreamDecoder.readBytes(Unknown Source) at sun.nio.cs.StreamDecoder.implRead(Unknown Source) at sun.nio.cs.StreamDecoder.read(Unknown Source) at java.io.InputStreamReader.read(Unknown Source) at java.io.BufferedReader.fill(Unknown Source) at java.io.BufferedReader.read(Unknown Source) at org.apache.commons.net.io.CRLFLineReader.readLine(CRLFLineReader.java:58) at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:310) at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:290) at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:474) at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:547) at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:596) at org.apache.commons.net.ftp.FTP.quit(FTP.java:804) at org.apache.commons.net.ftp.FTPClient.logout(FTPClient.java:941) at InternetServer.ftp(InternetServer.java:218) -----Urspr�ngliche Nachricht----- From: sebb Sent: Thursday, July 26, 2012 10:44 AM To: Commons Users List Subject: Re: [net] FTP client fails if a modem connection is used On 25 July 2012 18:56, Gregor Schmidt wrote: > Hello, > > I use the FTPClient class (API 3.0.1) for FTP file transfers. It works > fine as long as the internet connection is fast enough, e. g. 150 kbit/s > and above. With a modem connection at 56 kbit/s I can connect the server > but I get a read time out after the transfer of the file to the server > (size 31 kByte). Files on the server couldn't be downloaded at all. > Available FTP programs (WS-FTP etc.) don't have any problems with such a > low bitrate connection. > > It may be that an appropriate setting of the various timeout values could > solve the problem. Unfortunately I'm not a specialist in FTP or networking > in general. The current settings are: > DefaultTimeout = 0 (default) > SocketTimeout = 0 (default) > ConnectTimeout = 0 (default) > ControlKeepAliveTimeout = 300 seconds, set according to the example in the > API description > ControlKeepAliveReplyTimeout = 1000 milliseconds (default) > > Does somebody know an appropriate setting of the timeouts or a different > solution for my problem? What is the exact error you are getting? > Best regards, > Gregor --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org