mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-19 19:13:11 +08:00
Remove obsolete code.
This commit is contained in:
@@ -1,9 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using Microsoft.AspNetCore;
|
using Microsoft.AspNetCore;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.Extensions.Configuration;
|
|
||||||
using MQTTnet.Server.Configuration;
|
|
||||||
|
|
||||||
namespace MQTTnet.Server
|
namespace MQTTnet.Server
|
||||||
{
|
{
|
||||||
@@ -72,75 +69,9 @@ namespace MQTTnet.Server
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
//var listen = ReadListenSettings();
|
|
||||||
//webHost
|
|
||||||
// .UseKestrel(o =>
|
|
||||||
// {
|
|
||||||
// if (listen?.Length > 0)
|
|
||||||
// {
|
|
||||||
// foreach (var item in listen)
|
|
||||||
// {
|
|
||||||
// if (item.Address?.Trim() == "*")
|
|
||||||
// {
|
|
||||||
// if (item.Protocol == ListenProtocolTypes.MQTT)
|
|
||||||
// {
|
|
||||||
// o.ListenAnyIP(item.Port, c => c.UseMqtt());
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// o.ListenAnyIP(item.Port);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// else if (item.Address?.Trim() == "localhost")
|
|
||||||
// {
|
|
||||||
// if (item.Protocol == ListenProtocolTypes.MQTT)
|
|
||||||
// {
|
|
||||||
// o.ListenLocalhost(item.Port, c => c.UseMqtt());
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// o.ListenLocalhost(item.Port);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// if (IPAddress.TryParse(item.Address, out var ip))
|
|
||||||
// {
|
|
||||||
// if (item.Protocol == ListenProtocolTypes.MQTT)
|
|
||||||
// {
|
|
||||||
// o.Listen(ip, item.Port, c => c.UseMqtt());
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// o.Listen(ip, item.Port);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// o.ListenAnyIP(1883, l => l.UseMqtt());
|
|
||||||
// o.ListenAnyIP(5000);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
webHost.UseStartup<Startup>();
|
webHost.UseStartup<Startup>();
|
||||||
|
|
||||||
return webHost;
|
return webHost;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ListenModel[] ReadListenSettings()
|
|
||||||
{
|
|
||||||
var builder = new ConfigurationBuilder()
|
|
||||||
.AddJsonFile("appsettings.json")
|
|
||||||
.AddEnvironmentVariables()
|
|
||||||
.Build();
|
|
||||||
|
|
||||||
var listen = new List<ListenModel>();
|
|
||||||
builder.Bind("MQTTnetServer:Listen", listen);
|
|
||||||
|
|
||||||
return listen.ToArray();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user