无法连接到 ftp 服务器 java

发布于 2024-10-08 21:11:21 字数 305 浏览 13 评论 0原文

我应该能够成功地向/从 FTP 服务器发送和接收文件。

但后来,代码中没有发生任何变化,我开始得到这个:

错误:java.net.ConnectException:连接超时:连接

我正在做的是:

FTPClient ftp = new FTPClient();

ftp.connect( IPADDRESS of FTP server);

connect() 正在给出此执行。我不明白其原因。

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

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

Error: java.net.ConnectException: Connection timed out: connect

What I am doing is:

FTPClient ftp = new FTPClient();

ftp.connect( IPADDRESS of FTP server);

connect() is giving this execption. I am not understanding the cause for it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

自由如风 2024-10-15 21:11:21

该错误消息告诉您操作系统尝试连接到服务器超时。这通常意味着:

  • 远程服务器已断开网络,或者
  • 某些东西(例如防火墙)通过 FTP 端口发送到服务器的“黑洞”数据包。

The error message is telling you that the OS's attempt to connect to the server timed out. This typically means that:

  • the remote server has dropped off the network, or
  • something (e.g. a firewall) is "black holing" packets sent to the server on the FTP port.
つ可否回来 2024-10-15 21:11:21

表示尝试将套接字连接到远程地址和端口时发生错误。通常,连接被远程拒绝(例如,没有进程正在侦听远程地址/端口)。

来源:JavaDoc

Signals that an error occurred while attempting to connect a socket to a remote address and port. Typically, the connection was refused remotely (e.g., no process is listening on the remote address/port).

Source: JavaDoc.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文