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 })); } }
/// <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); } }
/// <summary> /// Constructor. Performs TCP connection and /// sets up reader/writer. Allows different control /// port to be used /// </summary> /// <param name="remoteHost"> /// Remote inet address /// </param> /// <param name="controlPort"> /// port for control stream /// </param> /// <param name="timeout"> /// the length of the timeout, in milliseconds /// </param> /// <param name="encoding"> /// encoding to use for control channel /// </param> internal FTPControlSocket(string remoteHost, int controlPort, int timeout, Encoding encoding) { if (activePortRange != null) { activePortRange.ValidateRange(); } 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 })); } }
/// <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); } }