private void SendRequest(SftpRequest request) { lock (this._requests) { this._requests.Add(request.RequestId, request); } this.SendMessage(request); }
private void SendRequest(SftpRequest request) { lock (_requests) { _requests.Add(request.RequestId, request); } SendMessage(request); }
private void SendRequest(SftpRequest request) { lock (this._requests) { this._requests.Add(request.RequestId, request); } this.SendData(new SftpDataMessage(this.ChannelNumber, request)); }
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); }
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); }