Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > FTPClient and CopyStreamAdapter stop sometimes

Reply
Thread Tools

FTPClient and CopyStreamAdapter stop sometimes

 
 
Susanne Kaufmann
Guest
Posts: n/a
 
      06-27-2008
I have an applet which Downloads some files from an FTP(S) Server.
Mostly everything works fine, but sometimes the application "stops"
for a long time (several minutes) after the "RETR filename" command.
PErhaps someone knows this problem or has an idea.

Thank you in advance for any hint,

Susanne


Here is some of my code:

try {
InputStream stO =
new BufferedInputStream(
ftps.retrieveFileStream(fileName),
ftps.getBufferSize());

org.apache.commons.net.io.Util.copyStream(
stO,
fout,
ftps.getBufferSize(),
//
org.apache.commons.net.io.CopyStreamEvent.UNKNOWN_ STREAM_SIZE,
length,
new org.apache.commons.net.io.CopyStreamAdapter() {
public void bytesTransferred(long
totalBytesTransferred,
int bytesTransferred,
long streamSize) {
changeSupport.firePropertyChange(FTPPERCENT, null,
totalBytesTransferred*100/length);
}
});
} catch (Exception e) {
e.printStackTrace();
}
 
Reply With Quote
 
 
 
 
Martin Gregorie
Guest
Posts: n/a
 
      06-28-2008
On Fri, 27 Jun 2008 00:44:53 -0700, Susanne Kaufmann wrote:

> I have an applet which Downloads some files from an FTP(S) Server.
> Mostly everything works fine, but sometimes the application "stops"
> for a long time (several minutes) after the "RETR filename" command.
> PErhaps someone knows this problem or has an idea.
>

Do you know whether the pause is at the machine running the applet or at
the server end?

If you use a bare web browser to do the download do you see pauses?


--
martin@ | Martin Gregorie
gregorie. |
org | Zappa fan & glider pilot


 
Reply With Quote
 
 
 
 
Susanne Kaufmann
Guest
Posts: n/a
 
      06-30-2008
It is at the client site, because I can download from the server
without pauses using a ftp client or the bare browser.

 
Reply With Quote
 
Gordon Beaton
Guest
Posts: n/a
 
      06-30-2008
On Mon, 30 Jun 2008 02:21:28 -0700 (PDT), Susanne Kaufmann wrote:
> It is at the client site, because I can download from the server
> without pauses using a ftp client or the bare browser.


Is the client behind a firewall? Do you use ftp in passive or active
mode? Can you download without problems from a different ftp server?

Instead of guessing what might be causing the problem, use a tool like
Wireshark to see what's really happening between your client and the
server. Remember that there are two active connections: one for
transferring commands, and one for transferring data.

/gordon

--

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FTPClient Help Pradeep Java 2 08-26-2006 02:39 PM
JavaScript sometimes working ok and sometimes not Kamyk Javascript 2 05-08-2005 01:28 PM
FTPClient slow on laptops Barbara Vernaeve Java 0 11-18-2004 05:00 PM
sun.net.ftp.FtpClient Neeraj Vibhasrao Kulkarni Java 1 11-15-2004 10:39 PM
? Content Entered in Forms Sometimes Duplicated and Sometimes Not ? Nehmo Sergheyev HTML 1 05-09-2004 07:07 PM



Advertisments