Failed to connect to java ftp server

I should be able to successfully send and receive files to / from an FTP server.

But then no changes to the code occurred, and I started getting this:

Error: java.net.ConnectException: connection timeout: connect

What am I doing:

FTPClient ftp = new FTPClient(); ftp.connect( IPADDRESS of FTP server); 

connect() gives this execution. I do not understand the reason for this.

+4
source share
2 answers

The error message states that the OS is trying to connect to the server. This usually means that:

  • the remote server has disconnected from the network or
  • something (for example, a firewall) is a backdoor packet sent to the server via an FTP port.
+2
source

Reports that an error occurred while trying to connect the socket to the remote address and port. Typically, the connection was refused remotely (for example, no process is listening on the remote address / port).

Source: JavaDoc .

0
source

Source: https://habr.com/ru/post/1332867/


All Articles