/// <summary>
 /// Set the port range to use in active mode
 /// </summary>
 /// <param name="portRange">port range to use</param>
 internal void SetActivePortRange(PortRange portRange)
 {
     portRange.ValidateRange();
     activePortRange = portRange;
     if (!portRange.UseOSAssignment)
     {
         Random rand = new Random();
         nextPort = rand.Next(activePortRange.LowPort, activePortRange.HighPort);
         log.Debug("SetActivePortRange(" + activePortRange.LowPort + "," + activePortRange.HighPort + "). NextPort=" + nextPort);
     }
 }
 internal FTPControlSocket()
 {
     this.log = Logger.GetLogger("FTPControlSocket");
     this.synchronizePassiveConnections = false;
     this.strictReturnCodes             = false;
     this.remoteHost                = null;
     this.remoteAddr                = null;
     this.controlPort               = -1;
     this.controlSock               = null;
     this.timeout                   = 0;
     this.writer                    = null;
     this.reader                    = null;
     this.activePortRange           = null;
     this.activeIPAddress           = null;
     this.nextPort                  = 0;
     this.autoPassiveIPSubstitution = false;
 }
 internal FTPControlSocket()
 {
     this.log = Logger.GetLogger("FTPControlSocket");
     this.synchronizePassiveConnections = false;
     this.strictReturnCodes = false;
     this.remoteHost = null;
     this.remoteAddr = null;
     this.controlPort = -1;
     this.controlSock = null;
     this.timeout = 0;
     this.writer = null;
     this.reader = null;
     this.activePortRange = null;
     this.activeIPAddress = null;
     this.nextPort = 0;
     this.autoPassiveIPSubstitution = false;
 }
 internal FTPControlSocket(string remoteHost, int controlPort, int timeout, Encoding encoding)
 {
     this.log = Logger.GetLogger("FTPControlSocket");
     this.synchronizePassiveConnections = false;
     this.strictReturnCodes             = false;
     this.remoteHost                = null;
     this.remoteAddr                = null;
     this.controlPort               = -1;
     this.controlSock               = null;
     this.timeout                   = 0;
     this.writer                    = null;
     this.reader                    = null;
     this.activePortRange           = null;
     this.activeIPAddress           = null;
     this.nextPort                  = 0;
     this.autoPassiveIPSubstitution = false;
     if (this.activePortRange != null)
     {
         this.activePortRange.ValidateRange();
     }
     this.Initialize(new StandardSocket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp), remoteHost, controlPort, timeout, encoding);
 }
 internal FTPControlSocket(string remoteHost, int controlPort, int timeout, Encoding encoding)
 {
     this.log = Logger.GetLogger("FTPControlSocket");
     this.synchronizePassiveConnections = false;
     this.strictReturnCodes = false;
     this.remoteHost = null;
     this.remoteAddr = null;
     this.controlPort = -1;
     this.controlSock = null;
     this.timeout = 0;
     this.writer = null;
     this.reader = null;
     this.activePortRange = null;
     this.activeIPAddress = null;
     this.nextPort = 0;
     this.autoPassiveIPSubstitution = false;
     if (this.activePortRange != null)
     {
         this.activePortRange.ValidateRange();
     }
     this.Initialize(new StandardSocket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp), remoteHost, controlPort, timeout, encoding);
 }
 internal void SetActivePortRange(PortRange portRange)
 {
     portRange.ValidateRange();
     this.activePortRange = portRange;
     if (!portRange.UseOSAssignment)
     {
         this.nextPort = new Random().Next(this.activePortRange.LowPort, this.activePortRange.HighPort);
         this.log.Debug(string.Concat(new object[] { "SetActivePortRange(", this.activePortRange.LowPort, ",", this.activePortRange.HighPort, "). NextPort=", this.nextPort }));
     }
 }
Beispiel #7
0
 public FTPClient()
 {
     this.dirEmptyStrings = new DirectoryEmptyStrings();
     this.transferCompleteStrings = new TransferCompleteStrings();
     this.fileNotFoundStrings = new FileNotFoundStrings();
     this.modtimeFormats = new string[] { "yyyyMMddHHmmss", "yyyyMMddHHmmss'.'f", "yyyyMMddHHmmss'.'ff", "yyyyMMddHHmmss'.'fff" };
     this.control = null;
     this.data = null;
     this.timeout = 0x1d4c0;
     this.noOperationInterval = 0;
     this.strictReturnCodes = false;
     this.cancelTransfer = false;
     this.transferNotifyListings = false;
     this.resume = false;
     this.deleteOnFailure = true;
     this.mdtmSupported = true;
     this.sizeSupported = true;
     this.resumeMarker = 0L;
     this.showHiddenFiles = false;
     this.monitorInterval = 0x1000L;
     this.transferBufferSize = 0x1000;
     this.parserCulture = CultureInfo.InvariantCulture;
     this.fileFactory = new EnterpriseDT.Net.Ftp.FTPFileFactory();
     this.transferType = FTPTransferType.ASCII;
     this.connectMode = FTPConnectMode.PASV;
     this.synchronizePassiveConnections = false;
     this.activePortRange = new PortRange();
     this.activeIPAddress = null;
     this.controlPort = -1;
     this.remoteHost = null;
     this.autoPassiveIPSubstitution = false;
     this.closeStreamsAfterTransfer = true;
     this.controlEncoding = null;
     this.dataEncoding = null;
     this.throttler = null;
     this.InitBlock();
 }
Beispiel #8
0
 /// <summary>
 /// Set the port range to use in active mode
 /// </summary>
 /// <param name="portRange">port range to use</param>
 internal void SetActivePortRange(PortRange portRange)
 {
     portRange.ValidateRange();
     activePortRange = portRange;
     if (!portRange.UseOSAssignment)
     {
         Random rand = new Random();
         nextPort = rand.Next(activePortRange.LowPort,activePortRange.HighPort);
         log.Debug("SetActivePortRange("+ activePortRange.LowPort + "," + activePortRange.HighPort + "). NextPort=" + nextPort);
     }
 }