Remove obsolete code.

This commit is contained in:
Christian Kratky
2019-03-10 14:55:17 +01:00
parent ebcce9b8be
commit 2ca6866c5e
-69
View File
@@ -1,9 +1,6 @@
using System;
using System.Collections.Generic;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using MQTTnet.Server.Configuration;
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>();
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();
}
}
}