public override void Start()
 {
     Session _session = getSession();
     try
     {
         Request request;
         if (xforwading)
         {
             request = new RequestX11();
             request.request(_session, this);
         }
         if (pty)
         {
             request = new RequestPtyReq();
             request.request(_session, this);
         }
         request = new RequestSubsystem();
         ((RequestSubsystem)request).request(_session, this, subsystem, want_reply);
     }
     catch (Exception e)
     {
         if (e is JSchException) { throw (JSchException)e; }
         throw new JSchException("ChannelSubsystem",e);
     }
     if (io.In != null)
     {
         thread = new Thread(this.run);
         thread.Name="Subsystem for " + _session.host;
         if (_session.daemon_thread)
         {
             thread.IsBackground=_session.daemon_thread;
         }
         thread.Start();
     }
 }
Beispiel #2
0
        protected void sendRequests()
        {
            Session _session = getSession();
            Request request;

            if (agent_forwarding)
            {
                request = new RequestAgentForwarding();
                request.request(_session, this);
            }

            if (xforwading)
            {
                request = new RequestX11();
                request.request(_session, this);
            }

            if (pty)
            {
                request = new RequestPtyReq();
                ((RequestPtyReq)request).setTType(ttype);
                ((RequestPtyReq)request).setTSize(tcol, trow, twp, thp);
                if (terminal_mode != null)
                {
                    ((RequestPtyReq)request).setTerminalMode(terminal_mode);
                }
                request.request(_session, this);
            }

            if (env != null)
            {
                foreach (KeyValuePair <byte[], byte[]> kv in env)
                {
                    request = new RequestEnv();
                    ((RequestEnv)request).setEnv(kv.Key, kv.Value);
                    request.request(_session, this);
                }
            }
        }
        public override void Start()
        {
            Session _session = getSession();

            try
            {
                Request request;
                if (xforwading)
                {
                    request = new RequestX11();
                    request.request(_session, this);
                }
                if (pty)
                {
                    request = new RequestPtyReq();
                    request.request(_session, this);
                }
                request = new RequestSubsystem();
                ((RequestSubsystem)request).request(_session, this, subsystem, want_reply);
            }
            catch (Exception e)
            {
                if (e is JSchException)
                {
                    throw (JSchException)e;
                }
                throw new JSchException("ChannelSubsystem", e);
            }
            if (io.In != null)
            {
                thread      = new Thread(this.run);
                thread.Name = "Subsystem for " + _session.host;
                if (_session.daemon_thread)
                {
                    thread.IsBackground = _session.daemon_thread;
                }
                thread.Start();
            }
        }
        protected void sendRequests()
        {
            Session _session = getSession();
            Request request;
            if (agent_forwarding)
            {
                request = new RequestAgentForwarding();
                request.request(_session, this);
            }

            if (xforwading)
            {
                request = new RequestX11();
                request.request(_session, this);
            }

            if (pty)
            {
                request = new RequestPtyReq();
                ((RequestPtyReq)request).setTType(ttype);
                ((RequestPtyReq)request).setTSize(tcol, trow, twp, thp);
                if (terminal_mode != null)
                {
                    ((RequestPtyReq)request).setTerminalMode(terminal_mode);
                }
                request.request(_session, this);
            }

            if (env != null)
            {
                foreach(KeyValuePair<byte[],byte[]> kv in env)
                {
                    request = new RequestEnv();
                    ((RequestEnv)request).setEnv(kv.Key, kv.Value);
                    request.request(_session, this);
                }
            }
        }