Skip to content

Instantly share code, notes, and snippets.

@thaianhduc
Created October 16, 2018 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thaianhduc/ff7ac02c5745788f68f4dd750dba3090 to your computer and use it in GitHub Desktop.
Save thaianhduc/ff7ac02c5745788f68f4dd750dba3090 to your computer and use it in GitHub Desktop.
A consumer of Request/Response service which stimulates a file download.
static void Main(string[] args)
{
var filename = args[0];
var service = new ServiceImpl();
var response = service.Execute(new Request {Payload = filename});
var actualData = BinaryDataContractSerializer.Deserialize<DownloadFileResponse>(response);
Console.WriteLine($"Congratulation! You have just downloaded {actualData.Data.Length} bytes.");
Console.WriteLine("How about the total memory consumed?");
Console.Read();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment