Program.cs 588 B

12345678910111213141516171819202122
  1. using Hprose.RPC;
  2. using PackageInterface;
  3. using System;
  4. using System.Net;
  5. namespace PackageServer
  6. {
  7. class Program
  8. {
  9. static void Main(string[] args)
  10. {
  11. var service = new Service();
  12. service.AddInstanceMethods(new PackageManager(), nameof(IPackageManager));
  13. var httpServer = new HttpListener();
  14. httpServer.Prefixes.Add("http://*:10100/");
  15. httpServer.Start();
  16. service.Bind(httpServer);
  17. Console.WriteLine("PackageServer started.");
  18. Console.ReadLine();
  19. }
  20. }
  21. }