通过3G ftpclient [英] ftpclient via 3g

查看:156
本文介绍了通过3G ftpclient的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Apache的FTP客户端上传文件到服务器。如果我有一个Wi-Fi连接到我的家庭路由器一切顺利。如果我没有3G的图标将出现在通知栏的Wi-Fi连接,但ftp.connect给出了一个错误通过对等连接复位。我GOOGLE了周围这一点,但没有发现任何帮助。是ftpclient无法与3G合作?

I am using Apache Commons ftp client to upload a file to a server. If I have a wi-fi connection to my home router all goes well. If I dont have that wi-fi connection the 3G icon appears in the notification bar but the ftp.connect gives an error 'connection reset by peer'. I've googled around for this but not found anything that helps. Is ftpclient not able to work with 3G?

推荐答案

一个普通的FTP文件传输(主动模式)使用两个连接 - 一个由客户建立的,一个从服务器传送数据建立的。随着3G连接通常被NAT系统防火墙服务器无法到达客户端。因此,只有在被动模式下的连接是可能的。

A regular FTP file transfer (in active mode) uses two connections - one established by the client and one established from the server for transferring the data. As 3G connections are usually firewalled by a NAT system the server can not reach the client. Therefore only connections in passive mode are possible.

您是否尝试过使用被动模式。它应该通过调用配置的 enterLocalPassiveMode()上的 FtpClient 实例。

Have you tried to use the passive mode. It should be configurable by calling enterLocalPassiveMode() on the FtpClient instance.

这篇关于通过3G ftpclient的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆