Example #1
0
		protected virtual void ConnectChannel()
		{
			m_channel = m_session.openChannel(ChannelType);
			this.OnChannelReceived();
			m_channel.connect();
			this.OnConnected();
		}
Example #2
0
File: Scp.cs Project: itsbth/GLuaR
        /// <summary>
        /// Connect a channel to the remote server using the 'SCP TO' command ('scp -t')
        /// </summary>
        /// <param name="channel">Will contain the new connected channel</param>
        /// <param name="server">Will contaun the new connected server I/O stream</param>
        /// <param name="rfile">The remote path on the server</param>
        /// <param name="recursive">Idicate a recursive scp transfer</param>
        protected void SCP_ConnectTo(out Channel channel, out Stream server, string rfile, bool recursive)
        {
            string scpCommand = "scp -p -t ";
            if(recursive) scpCommand += "-r ";
            scpCommand += "\""+rfile+"\"";

            channel = (ChannelExec)m_session.openChannel(ChannelType);
            ((ChannelExec)channel).setCommand(scpCommand);

            server =
                new Fireball.Streams.CombinedStream
                (channel.getInputStream(), channel.getOutputStream());
            channel.connect();

            SCP_CheckAck(server);
        }