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

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

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

            this.SendData(new SftpDataMessage(this.ChannelNumber, request));
        }
Exemplo 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);
        }
Exemplo 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);
        }