Program.cs 809 B

123456789101112131415161718192021222324252627282930
  1. // See https://aka.ms/new-console-template for more information
  2. using CompServ;
  3. using CompServ.ClientLibrary;
  4. Console.WriteLine("Hello, World!");
  5. var wClient = new CompServWorkerClient(args[0]);
  6. Console.WriteLine("Checking alive...");
  7. var isAlive = await wClient.CheckAliveAsync();
  8. Console.WriteLine("Alive: " + isAlive);
  9. if (isAlive)
  10. {
  11. var dataToCompress1 = new byte[4096];
  12. dataToCompress1[0] = (byte)'a';
  13. dataToCompress1[1] = (byte)'b';
  14. dataToCompress1[2] = (byte)'c';
  15. var compressedBytes = await wClient.CompressAsync(new CompressRequestModel { Level = 1, Threads = 1, DataToCompress = dataToCompress1 });
  16. var decompress = await wClient.DecompressAsync(compressedBytes);
  17. int bp = 0;
  18. }
  19. Console.WriteLine();
  20. Console.Write("Press ENTER to exit...");
  21. Console.ReadLine();