FtpSession constructor
FtpSession(
- Socket _controlSocket, {
- String? username,
- String? password,
- required FileOperations fileOperations,
- required ServerType serverType,
- required LoggerHandler logger,
- SecurityContext? securityContext,
- FtpSecurityMode securityMode = FtpSecurityMode.none,
- bool requireEncryptedData = false,
- bool tlsActive = false,
- void onDisconnect()?,
Implementation
FtpSession(
this._controlSocket, {
this.username,
this.password,
required FileOperations fileOperations,
required this.serverType,
required this.logger,
this.securityContext,
this.securityMode = FtpSecurityMode.none,
this.requireEncryptedData = false,
this.tlsActive = false,
this.onDisconnect,
}) : fileOperations = fileOperations.copy(),
commandHandler = FTPCommandHandler(logger),
pbszReceived = tlsActive,
protectionLevel =
tlsActive ? ProtectionLevel.private_ : ProtectionLevel.clear {
sendResponse('220 Welcome to the FTP server');
logger.generalLog('FtpSession created. Ready to process commands.');
_attachControlListener();
}