I have implemented an FTP server based on this here Apache project: http://mina.apache.org/ftpserver-project/index.html
The server is meant to support passive mode and configured accordingly. For testing purposes, I have configured one passive port only (4244), but nothing is listening on this port after starting the server. The FTP server is listening ok on the standard port for active connections and on the one for SSL connections.
When trying to connect with an FTP client, I get the following error (not surprisingly):
Status: Resolving address of localhost
Status: Connecting to [::1]:4244...
Status: Connection attempt failed with "ECONNREFUSED - Connection refused by server", trying next address.
Status: Connecting to [fe80::1%lo0]:4244...
Status: Connection attempt failed with "ECONNREFUSED - Connection refused by server", trying next address.
Status: Connecting to 127.0.0.1:4244...
Status: Connection attempt failed with "ECONNREFUSED - Connection refused by server".
Error: Could not connect to server
My configuration object is implementing this interface from the Apache project: DataConnectionConfiguration
I have put some logging into the class and noticed that the methods for providing passive ports are never called. I would expected one of the methods (such as requestPassivePort() ) to be called, because how else would the FTP Server know what passive port to listen on? Then again, perhaps I have a misunderstanding regarding the workings of passive FTP. Even though there is some documentation in the Apache project, there isn't much about running a server in passive mode.
Perhaps someone has successfully implemented a passive FTP server using this Apache library and could provide me with some help.
Thanks a lot.
Cheers,
Martin