When an FTP client initiates a connection request, the FTP Daemon accepts and opens a Control Connection, and then spawns a thread group which acts as the FTP Protocol Engine and processes further requests from the client. A data connection is established between the Protocol Engine and the FTP client whenever required for file transfer.
When the FTPServer.NLM is loaded, the FTP daemon is started. The FTP daemon initializes the Configuration Parameters, Access Restrictions, Catalog services, Logs and statistics. The FTP Daemon binds to the FTP port specified in the configuration file and listens for connection requests from the clients.
On executing load ftpserv command, the FTP daemon is executed as the main thread. The FTP server can be unloaded at any time on executing the unload ftpserv command. While coming up, FTP Server initializes the following operations:
After initialization, the FTP Daemon binds to the standard FTP port (21) or the port specified in the configuration file and listens for connection requests from FTP clients. On receiving a connection request, it establishes the Control Connection with the FTP client. It, then spawns a new thread in a separate thread group and hands over the socket information to Protocol Engine (ProtocolEngine) for processing the FTP commands that it receives on the connection.