FtpSession constructor

FtpSession(
  1. Socket _controlSocket, {
  2. String? username,
  3. String? password,
  4. required FileOperations fileOperations,
  5. required ServerType serverType,
  6. required LoggerHandler logger,
  7. SecurityContext? securityContext,
  8. FtpSecurityMode securityMode = FtpSecurityMode.none,
  9. bool requireEncryptedData = false,
  10. bool tlsActive = false,
  11. 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();
}