Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
12k views
in Java FTP by
int controlPort

If I set it to 21 it connects to FTP but if I have the FTP set to a different port and change the 21 to a different one it can't connect to ftp.

What do i have to do to mnake it possible to connect to other ports?

Thx in advance I am testing the library atm and I like it :)

10 Answers

0 votes
by
If you are using the constructor:

FTPClient(String remoteHost, int controlPort, 
                     PrintWriter log, int timeout)


I've noticed that there is a bug - change line 251 (in 1.3.0) in FTPClient.java from

this(InetAddress.getByName(remoteHost), FTPControlSocket.CONTROL_PORT, log, timeout);

to

this(InetAddress.getByName(remoteHost), controlPort, log, timeout);

Alternatively, this will be fixed in 1.3.1


int controlPort

If I set it to 21 it connects to FTP but if I have the FTP set to a different port and change the 21 to a different one it can't connect to ftp.

What do i have to do to mnake it possible to connect to other ports?

Thx in advance I am testing the library atm and I like it :)
0 votes
by
Oh thx for the quick answer will need to wait for new version then though...

I hope you will fix that for SSL too...
0 votes
by
I am testing with edtftpj-ssl-trial just to let you know
0 votes
by
Yes, all edtFTPj bug fixes get fed into edtFTPj/SSL (as do the enhancements).

Oh thx for the quick answer will need to wait for new version then though...

I hope you will fix that for SSL too...
0 votes
by
This bug is now fixed in the latest release, 1.3.1, available now.

Support
Enterprise Distributed Technologies
0 votes
by
say like i want to use port 4444 instead of 21

can i do this:

FTPClient client = new FTPClient(xxx.xxx.xxx.xxx, 4444);


is that right?
0 votes
by
That's right, if the FTP server is configured to listen on 4444.

Note that edtFTPj 1.3.1 or edtFTPj/SSL 1.1.0 is required (to fix the bug mentioned above)

say like i want to use port 4444 instead of 21

can i do this:

FTPClient client = new FTPClient(xxx.xxx.xxx.xxx, 4444);


is that right?
0 votes
by
i just changed the setting to my WinProxy setting
before FTP Gateway is listening to port 21 then i changed to it 4444

rebooted WinProxy

tried my program to connect to port 4444

FTPClient client = new FTPClient(xxx.xxx.xxx.xxx, 4444);
and i couldnt connect to it.

But when i switched the WinProxy's FTP Gateway setting back to port 21, my program is working fine, regardless i set the port to 21, 3128 (winproxy default), or 4444....

Kinda confusing
0 votes
by
apparently im still using older version..
i'll post again for the results

sorry again
0 votes
by
im using the latest version
that bug has been solved

thanks :)

Categories

...