Server Module#
The server module contains the main FTP server implementation.
Server module for thinFTP.
This module defines the threaded TCP server for the FTP service. It uses Python’s built-in socketserver.ThreadingTCPServer to handle multiple client connections concurrently.
- class thinftp.server.ThreadedThinFTP(addr, handler, config)[source]#
Bases:
ThreadingTCPServerA threaded FTP server class for handling multiple client connections.
- config#
A configuration object containing server settings.
- Type:
Namespace
- lgr#
Logger instance used for logging server events.
- Type:
- daemon_threads = True#
- thinftp.server.start_server(config)[source]#
Start and run the FTP server using the provided configuration.
This function binds the server to the given host and port, logs startup information, and enters the request-handling loop.
- Parameters:
config (Namespace) – Configuration object containing: - bind (str): IP address to bind the server. - port (int): Port to listen on. - user (str): FTP username. - pswd (str): FTP password. - directory (str): Directory to serve. - lgr (Logger): Preconfigured logger instance.
ThreadedThinFTP Class#
- class thinftp.server.ThreadedThinFTP(addr, handler, config)[source]#
Bases:
ThreadingTCPServerA threaded FTP server class for handling multiple client connections.
- config#
A configuration object containing server settings.
- Type:
Namespace
- lgr#
Logger instance used for logging server events.
- Type:
- daemon_threads = True#