mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-16 17:23:04 +08:00
fixed core 3.1 startup and verified it still works with 2.1 and net461
This commit is contained in:
@@ -1,19 +1,21 @@
|
||||
using Microsoft.AspNetCore;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using MQTTnet.AspNetCore;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MQTTnet.TestApp.AspNetCore2
|
||||
{
|
||||
public static class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
public static Task Main(string[] args)
|
||||
{
|
||||
BuildWebHost(args).Run();
|
||||
return BuildWebHost(args).RunAsync();
|
||||
}
|
||||
|
||||
private static IWebHost BuildWebHost(string[] args) =>
|
||||
WebHost.CreateDefaultBuilder(args)
|
||||
.UseKestrel(o => {
|
||||
.UseKestrel(o =>
|
||||
{
|
||||
o.ListenAnyIP(1883, l => l.UseMqtt());
|
||||
o.ListenAnyIP(5000); // default http pipeline
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user