You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

27 lines
735 B

  1. using Microsoft.AspNetCore;
  2. using Microsoft.AspNetCore.Hosting;
  3. using MQTTnet.AspNetCore;
  4. using System.Threading.Tasks;
  5. using MQTTnet.AspNetCore.Extensions;
  6. namespace MQTTnet.TestApp.AspNetCore2
  7. {
  8. public static class Program
  9. {
  10. public static Task Main(string[] args)
  11. {
  12. return BuildWebHost(args).RunAsync();
  13. }
  14. private static IWebHost BuildWebHost(string[] args) =>
  15. WebHost.CreateDefaultBuilder(args)
  16. .UseKestrel(o =>
  17. {
  18. o.ListenAnyIP(1883, l => l.UseMqtt());
  19. o.ListenAnyIP(5000); // default http pipeline
  20. })
  21. .UseStartup<Startup>()
  22. .Build();
  23. }
  24. }