• Post Reply Bookmark Topic Watch Topic
  • New Topic

thread hangs while reading from URL

 
amar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using FTPClient to read from a file on the FTP server.

fileStream = ftpClient.retrieveFileStream(File)

buffReader = new BufferedReader(new InputStreamReader(fileStream));

I am using this while loop to read trough the file:

while((lineRead = buffReader.readLine()) != null)
{}


Once in a while program hangs while reading.
The program doesn't exit but rather stays up and running, but never gets past this line. It doesn't even timeout(I hve set the time out to 2 minutes). neither does it throw any exception.

I do catch the socketException and IOException

Can anyone suggest what must be happening?

Thanks
 
Joe Ess
Bartender
Posts: 9362
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, replytoamar. Please change your displayed name to conform to our
naming policy. In short, your name must be a first name and last name, separated by a space and not obviously fake.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!