Adds listening sockets to the configuration file (#172)

This commit is contained in:
Kamron Batman 2020-07-03 20:45:37 -07:00 • committed by GitHub
parent e17195ca80
commit f868c34678
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 153 additions and 39 deletions

View file

@ -32,8 +32,6 @@ namespace Server.Network
{
public static class TcpServer
{
public static List<IPEndPoint> Listeners { get; } = new List<IPEndPoint>();
// Make this thread safe
public static List<NetState> Instances { get; } = new List<NetState>();
@ -45,7 +43,7 @@ namespace Server.Network
.ConfigureServices(services => { services.AddSingleton<IMessagePumpService>(new MessagePumpService()); })
.UseKestrel(options =>
{
foreach (var ipep in Listeners)
foreach (var ipep in ServerConfiguration.Listeners)
{
options.Listen(ipep, builder => { builder.UseConnectionHandler<ServerConnectionHandler>(); });
m_ListeningAddresses = GetListeningAddresses(ipep);