Esempio n. 1
0
        public Entry RegisterChannelEventReceiver(SSHChannel ch, ISSHChannelEventReceiver r) {
            lock(this) {
                Entry e = new Entry(ch, r, _channel_sequence++);

                if(_first==null)
                    _first = e;
                else {
                    e.Next = _first;
                    _first = e;
                }

                _count++;
                return e;
            }
        }
Esempio n. 2
0
 public abstract void Run(SSHChannel channel);
Esempio n. 3
0
 public void EstablishPortforwarding(ISSHChannelEventReceiver rec, SSHChannel channel)
 {
     _pf = channel;
 }
Esempio n. 4
0
 public abstract void Run(SSHChannel channel); //start scp operation
Esempio n. 5
0
 public Entry(SSHChannel ch, ISSHChannelEventReceiver r, int seq)
 {
     _channel  = ch;
     _receiver = r;
     _localID  = seq;
 }
 public void OpenShell()
 {
     _channel = _connection.OpenShell(this);
 }
Esempio n. 7
0
 public SynchronizedSSHChannel(SSHChannel ch) {
     _channel = ch;
     _connection = _channel.Connection;
     _closed = false;
 }
Esempio n. 8
0
 internal void RegisterChannel(int local_id, SSHChannel ch) {
     FindChannelEntry(local_id).Channel = ch;
 }
Esempio n. 9
0
 internal void SetChannel(SSHChannel channel)
 {
     _channel = channel;
 }
Esempio n. 10
0
 public void Connect(Socket s)
 {
     _params.WindowSize = 0x1000;
     _params.IdentityFile = SSH2PrivateKeyFile;
     _conn = SSHConnection.Connect(_params, this, s);
     _pf = _conn.OpenShell(this);
     SSHConnectionInfo ci = _conn.ConnectionInfo;
 }
Esempio n. 11
0
 internal void SetChannel(SSHChannel channel)
 {
     _channel = channel;
 }
Esempio n. 12
0
 public override void Run(SSHChannel channel)
 {
     _channel = channel;
     _channelReadyEvent.WaitOne();
     SendResponse(); //これでやりとりがはじまる
 }
Esempio n. 13
0
 public abstract void Run(SSHChannel channel); //start scp operation
Esempio n. 14
0
        public override void Run(SSHChannel channel)
        {
            _channel = channel;

            try {
                WaitAndReset();
                Debug.Assert(_state == State.Failed || _state == State.WaitingFileInfoResponse);
                if (_state == State.Failed)
                    return;

                TransmitFileInfo();
                WaitAndReset();
                Debug.Assert(_state == State.Failed || _state == State.SendingContent);
                if (_state == State.Failed)
                    return;

                TransmitFileContent();
                WaitAndReset();
                Debug.Assert(_state == State.Failed || _state == State.Completed);

                if (_state == State.Completed) {
                    SuccessfullyExit();
                }
            }
            catch (Exception ex) {
                UnsuccessfullyExit(ex);
            }
            finally {
                _param.LocalSource.Close();
            }
        }
Esempio n. 15
0
 public override void EstablishPortforwarding(ISSHChannelEventReceiver receiver, SSHChannel channel) {
     try {
         Channel ch = (Channel)receiver;
         ch.FixChannel(channel);
         ch.OnChannelReady();
         ch.StartAsyncReceive();
     }
     catch (Exception ex) {
         Debug.WriteLine(ex.StackTrace);
         Util.InterThreadWarning(ex.Message);
     }
 }
Esempio n. 16
0
 public override void Run(SSHChannel channel)
 {
     _channel = channel;
     _channelReadyEvent.WaitOne();
     SendResponse(); //これでやりとりがはじまる
 }
Esempio n. 17
0
        public Channel(string servername, string rd, int cid, SSHChannel channel, Socket socket) {
            _serverName = servername;
            _remoteDescription = rd;
            _connectionID = cid;
            _wroteClosedLog = false;

            if (channel != null)
                _channel = new SynchronizedSSHChannel(channel);
            _socket = new SynchronizedSocket(socket);
            _buffer = new byte[0x1000];
            _channelReady = new ManualResetEvent(false);
        }
Esempio n. 18
0
 public Entry(SSHChannel ch, ISSHChannelEventReceiver r, int seq) {
     _channel = ch;
     _receiver = r;
     _localID = seq;
 }
Esempio n. 19
0
 public void FixChannel(SSHChannel ch) {
     _channel = new SynchronizedSSHChannel(ch);
     Env.Log.LogChannelOpened(_remoteDescription, _connectionID);
 }
 public virtual void EstablishPortforwarding(ISSHChannelEventReceiver receiver, SSHChannel channel)
 {
 }
Esempio n. 21
0
 public override void Run(SSHChannel channel)
 {
     _channel = channel;
     _channelReadyEvent.WaitOne();
     SendResponse(); //����ł��Ƃ肪�͂��܂�
 }
 public void OpenSubsystem(string subsystem)
 {
     SSH2Connection ssh2 = _connection as SSH2Connection;
     if (ssh2 == null)
         throw new SSHException("OpenSubsystem() can be applied to only SSH2 connection");
     _channel = ssh2.OpenSubsystem(this, subsystem);
 }
Esempio n. 23
0
 internal void RegisterChannel(int local_id, SSHChannel ch)
 {
     FindChannelEntry(local_id).Channel = ch;
 }