Ejemplo n.º 1
0
        internal IAsyncResult BeginExecute(int timeout,
                                           string command,
                                           FtpDataType dataType,
                                           long restart,
                                           DTPStream userStream,
                                           AsyncCallback cb,
                                           object state)
        {
            RunDTP_SO stateObj = new RunDTP_SO(timeout,
                                               command,
                                               dataType,
                                               restart,
                                               userStream,
                                               cb,
                                               state);

            SetProgress(true);
            _currentDC = null;
            try
            {
                //----------------------------------------
                //Lock Control connection to prevent
                //run the command like abort, quit, stat
                //during configuring of data connection
                _cc.BeginLock(Timeout.Infinite,
                              new WaitOrTimerCallback(LockFirst_End),
                              stateObj);
            }
            catch (Exception e)
            {
                SetProgress(false);
                CheckDisposed();

                NSTrace.WriteLineError(_errMsg + e.ToString());
                throw;
            }
            catch
            {
                SetProgress(false);
                CheckDisposed();

                NSTrace.WriteLineError(_errMsgNonCls + Environment.StackTrace.ToString());
                throw;
            }
            return(stateObj);
        }
Ejemplo n.º 2
0
        internal IAsyncResult BeginExecute(int timeout, AsyncCallback cb, object state)
        {
            Quit_SO stateObj = new Quit_SO(timeout, cb, state);

            //----------------------------------------
            //Lock Control connection.
            //
            _cc.BeginLock(Timeout.Infinite,
                          new WaitOrTimerCallback(Lock_End),
                          stateObj);

            return(stateObj);
        }