|
|
|
@ -4,6 +4,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
using System; |
|
|
|
using System; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using System.Threading.Tasks; |
|
|
|
|
|
|
|
using CoreWCF.Configuration; |
|
|
|
using GBase.Api.Communication; |
|
|
|
using GBase.Api.Communication; |
|
|
|
using GBase.Logging; |
|
|
|
using GBase.Logging; |
|
|
|
using GBase.Logging.Interfaces; |
|
|
|
using GBase.Logging.Interfaces; |
|
|
|
@ -42,8 +43,9 @@ namespace GBase.Server |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static IWebHostBuilder CreateWebHostBuilder(IGBaseServerSettings serverSettings) => |
|
|
|
private static IWebHostBuilder CreateWebHostBuilder(IGBaseServerSettings serverSettings) |
|
|
|
WebHost.CreateDefaultBuilder() |
|
|
|
{ |
|
|
|
|
|
|
|
IWebHostBuilder webHostBuilder = WebHost.CreateDefaultBuilder() |
|
|
|
.UseKestrel(options => { options.Listen(serverSettings.IpAddress, serverSettings.Port); }) |
|
|
|
.UseKestrel(options => { options.Listen(serverSettings.IpAddress, serverSettings.Port); }) |
|
|
|
.UseUrls($"{serverSettings.Protocol.GetProtocolString()}{serverSettings.IpAddress}:{serverSettings.Port}") |
|
|
|
.UseUrls($"{serverSettings.Protocol.GetProtocolString()}{serverSettings.IpAddress}:{serverSettings.Port}") |
|
|
|
.ConfigureAppConfiguration((hostingContext, config) => |
|
|
|
.ConfigureAppConfiguration((hostingContext, config) => |
|
|
|
@ -56,5 +58,11 @@ namespace GBase.Server |
|
|
|
}); |
|
|
|
}); |
|
|
|
}) |
|
|
|
}) |
|
|
|
.UseStartup<Startup>(); |
|
|
|
.UseStartup<Startup>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (serverSettings.Protocol == ServerProtocol.Tcp) |
|
|
|
|
|
|
|
webHostBuilder.UseNetTcp(serverSettings.Port); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return webHostBuilder; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|