Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6550283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:11:49+00:00 2026-05-25T12:11:49+00:00

I am trying to make a ftp connection in Java with FTPClient. I wanted

  • 0

I am trying to make a ftp connection in Java with FTPClient.
I wanted to look what happens when i separate the line between Server and Client. My application freezed about 30seconds and then it thows a ConnectionException(Connection timed out). Thats why I searched for a timeout method for the FTPCliend and I found setDefaultTimeout() so I put the method before the connection attemp but it still freezed 30 sec…

    FTPClient ftp = new FTPClient();
    ftp.setDefaultTimeout(5000);
    ftp.connect(ip);

When i put “1.1.1.1” as ip the application throws fastly a ConnectionException(Connection refused) but when i put the right ipAdress its just freezing(30sec) and threwing the ConnectionException instead of the wished TimeoutException (after 5sec)

What am I doing wrong?

ps: excuse my horrible english knowledge 😉

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:11:51+00:00Added an answer on May 25, 2026 at 12:11 pm

    I’m not sure which FTPClient you’re using because there are a couple out there. However, they usually have two different timeout options : one for data and one for actual connection. I suggest you search for a method called setConnectTimeout() or similar.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the Apache FTP server in a web application in Java. A
Trying to make a MySQL-based application support MS SQL, I ran into the following
I am trying to make a FTP script in Python3.2 that connects to a
Im trying to check if a directory exists on an FTP server. Before you
I'm trying to make a change to an old appengine application, but now after
I'm trying make some stuff in jQuery using ASP.NET. But the ID from runat=server
I'm working on trying to ftp a file to the server through a silverlight
I am trying to connect to my ftp server by running a batch script.
I'm trying make an WPF application that I could copy/cut and paste files info
I am trying make long screen to vertical direction. So, I need a screen

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.