示例#1
0
        public override void Start()
        {
            Session _session = getSession();
            try
            {
                sendRequests();
                Request request = new RequestExec(command);
                request.request(_session, this);
            }
            catch (Exception e)
            {
                if (e is JSchException) throw (JSchException)e;
                throw new JSchException("ChannelExec",e);
            }

            if (io.In != null)
            {
                thread = new Thread(this.run);
                thread.Name="Exec thread " + _session.getHost();
                if (_session.daemon_thread)
                {
                    thread.IsBackground=_session.daemon_thread;
                }
                thread.Start();
            }
        }
示例#2
0
        public override void Start()
        {
            Session _session = getSession();

            try
            {
                sendRequests();
                Request request = new RequestExec(command);
                request.request(_session, this);
            }
            catch (Exception e)
            {
                if (e is JSchException)
                {
                    throw (JSchException)e;
                }
                throw new JSchException("ChannelExec", e);
            }

            if (io.In != null)
            {
                thread      = new Thread(this.run);
                thread.Name = "Exec thread " + _session.getHost();
                if (_session.daemon_thread)
                {
                    thread.IsBackground = _session.daemon_thread;
                }
                thread.Start();
            }
        }