Hi Steve, You are correct, there will be more than one instance running. So i should be allowing the FTP program to pick any port currently available.
Thanks for reply. Steve Cole-6 wrote: > > Will there ever be more than one instance of that client running on that > computer? If so, when the second instance tries to use those ports, it > will > throw an exception, won't it? > > ----- Original Message ----- > From: "Sathish Gopal" <[email protected]> > To: <[email protected]> > Sent: Friday, December 18, 2009 1:05 AM > Subject: Reg: How to set Data port on Commons FTP > > > Hi all, > > > > I'm pretty new to Commons API. I'm trying to use FTP API which is part > of Commons net and don't know much about FTP protocol either. > > > > My requirement is to create new file via FTP. > > > > I followed this link (http://slacksite.com/other/ftp.html) to understand > passive, active modes in FTP > > > > My real issue is that there are few firewall setting in the Client > side(the side from which file will be moved to another machine). > > > > From the above site I found that the FTP protocol at the client side > randomly opens two port one the Command port and Data port. > > > > When I looked at the API, I found the method > > > > public void connect(InetAddress > <http://java.sun.com/j2se/1.3/docs/api/java/net/InetAddress.html> host, > int port, InetAddress > <http://java.sun.com/j2se/1.3/docs/api/java/net/InetAddress.html> > localAddr, int localPort) throws SocketException > <http://java.sun.com/j2se/1.3/docs/api/java/net/SocketException.html> , > IOException > <http://java.sun.com/j2se/1.3/docs/api/java/io/IOException.html> > > But using the above method, I can only set the command port, Is there > any way I can set the Data Port used by FTP API. > > I don't want the API to randomly select Data port, because this port > might be blocked at the client. > > > > > > > Thanks and Regards > > Sathish Gopal > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > > -- View this message in context: http://n4.nabble.com/Reg-How-to-set-Data-port-on-Commons-FTP-tp974880p977594.html Sent from the Commons - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
