Esempio n. 1
0
        private void SendRequest(SftpRequest request)
        {
            lock (this._requests)
            {
                this._requests.Add(request.RequestId, request);
            }

            this.SendMessage(request);
        }
Esempio n. 2
0
        private void SendRequest(SftpRequest request)
        {
            lock (_requests)
            {
                _requests.Add(request.RequestId, request);
            }

            SendMessage(request);
        }
Esempio n. 3
0
        private void SendRequest(SftpRequest request)
        {
            lock (this._requests)
            {
                this._requests.Add(request.RequestId, request);
            }

            this.SendData(new SftpDataMessage(this.ChannelNumber, request));
        }
Esempio n. 4
0
        private void SendRequest(SftpRequest request)
        {
            lock (this._requests)
            {
                this._requests.Add(request.RequestId, request);
            }

            this.SendMessage(request);
            //this.SendData(new SftpDataMessage(this.ChannelNumber, request));

            //var messageData = request.GetBytes();

            //var data = new byte[4 + messageData.Length];

            //((uint)messageData.Length).GetBytes().CopyTo(data, 0);
            //messageData.CopyTo(data, 4);

            //this.SendData(data);
        }
Esempio n. 5
0
        private void HandleResponse(SftpResponse response)
        {
            SftpRequest request = null;

            lock (this._requests)
            {
                this._requests.TryGetValue(response.ResponseId, out request);
                if (request != null)
                {
                    this._requests.Remove(response.ResponseId);
                }
            }

            if (request == null)
            {
                throw new InvalidOperationException("Invalid response.");
            }

            request.Complete(response);
        }