Exemple #1
0
        /// <summary>Set the control socket explicitly.</summary>
        /// <param name="control">Control socket reference.</param>
        internal void Initialize(FTPControlSocket control)
        {
            this.control = control;
            this.control.CommandError += new FTPErrorEventHandler(CommandErrorControl);
			this.control.AutoPassiveIPSubstitution = autoPassiveIPSubstitution;
            this.control.SynchronizePassiveConnections = synchronizePassiveConnections;
            // set up the event handlers so they call back to this object - and can
            // then be passed on if required
            control.CommandSent += new FTPMessageHandler(CommandSentControl);
            control.ReplyReceived += new FTPMessageHandler(ReplyReceivedControl);
            if (activePortRange != null)
                control.SetActivePortRange(activePortRange);
            if (activeIPAddress != null)
                control.SetActiveIPAddress(activeIPAddress);
            control.StrictReturnCodes = strictReturnCodes;
            welcomeMessage = this.control.ValidateConnection().ReplyData;
        }
Exemple #2
0
 internal void Initialize(FTPControlSocket control)
 {
     this.control = control;
     this.control.AutoPassiveIPSubstitution = this.autoPassiveIPSubstitution;
     this.control.SynchronizePassiveConnections = this.synchronizePassiveConnections;
     control.CommandSent += new FTPMessageHandler(this.CommandSentControl);
     control.ReplyReceived += new FTPMessageHandler(this.ReplyReceivedControl);
     if (this.activePortRange != null)
     {
         control.SetActivePortRange(this.activePortRange);
     }
     if (this.activeIPAddress != null)
     {
         control.SetActiveIPAddress(this.activeIPAddress);
     }
     control.StrictReturnCodes = this.strictReturnCodes;
     this.control.ValidateConnection();
 }