|
@@ -51,9 +51,11 @@ namespace Vinno.FIS.Sonopost
|
|
|
if (CheckPortInUse(mainPort))
|
|
|
{
|
|
|
Logger.WriteLineWarn($"[{nameof(WebHost)}]{nameof(StartHttp)}:Port {mainPort} is occupied.");
|
|
|
- return;
|
|
|
}
|
|
|
- _httpListener.Prefixes.Add($"http://*:{mainPort}/");
|
|
|
+ else
|
|
|
+ {
|
|
|
+ _httpListener.Prefixes.Add($"http://*:{mainPort}/");
|
|
|
+ }
|
|
|
|
|
|
if (standbyPort > -1)
|
|
|
{
|
|
@@ -66,6 +68,10 @@ namespace Vinno.FIS.Sonopost
|
|
|
_httpListener.Prefixes.Add($"http://*:{standbyPort}/");
|
|
|
}
|
|
|
}
|
|
|
+ if (_httpListener.Prefixes.Count == 0)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
try
|
|
|
{
|
|
|
_httpListener.Start();
|