commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "13681228700" <>
Subject [net]
Date Fri, 13 Aug 2010 09:21:38 GMT

 Some question about creating DataConnection, when exists NAT.
In the following sence , it happen some wrong when creating DataConnection .
ftp server Listening at inner ip :  port 21
ftp client is behind the firewall , ftpServer inner ip through NAT is 
in the ftp client’s command console: 
can connected
return: entering passive mode ( port)
ftpserver return inner ip ,not after NAT ip(
client can’t connect inner ip, so connection is time out.
Because , ftpserver return’s message is ISO seventh layer datagram, router device just convert
IP layer datagram.
Modify some class to solve the problem:
1.       SocketClient class 
Add  var : private String _set_passive_host_ip 
In  connect method :
 add:   _set_passive_host_ip = hostname; 
2.       FTPClient class 
In __parsePassiveModeReply method:
 Add:  __passiveHost = _set_passive_host_ip; 
Use connect method parameter “hostname” as dataconnection “ip”. 
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message