From 8ec9a7964aa047a53b96227e4628317f2e6df39b Mon Sep 17 00:00:00 2001 From: Stone_Red <56473591+Stone-Red-Code@users.noreply.github.com> Date: Fri, 1 Dec 2023 14:07:52 +0100 Subject: [PATCH] Minor bug fixes --- HyperbolicDownloaderApi/Commands/HostCommands.cs | 1 + HyperbolicDownloaderApi/Managment/ApiManager.cs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/HyperbolicDownloaderApi/Commands/HostCommands.cs b/HyperbolicDownloaderApi/Commands/HostCommands.cs index 1ed4ac6..ab5b542 100644 --- a/HyperbolicDownloaderApi/Commands/HostCommands.cs +++ b/HyperbolicDownloaderApi/Commands/HostCommands.cs @@ -150,6 +150,7 @@ public class HostCommands { ApiManager.SendNotificationMessageNewLine($"Success! Added {recivedHosts.Count} new host(s).", NotificationMessageType.Success); hostsManager.AddRange(recivedHosts); + hostsManager.Add(new NetworkSocket(ipAddress.ToString(), port, DateTime.Now)); } else { diff --git a/HyperbolicDownloaderApi/Managment/ApiManager.cs b/HyperbolicDownloaderApi/Managment/ApiManager.cs index 94e697e..213bd87 100644 --- a/HyperbolicDownloaderApi/Managment/ApiManager.cs +++ b/HyperbolicDownloaderApi/Managment/ApiManager.cs @@ -81,6 +81,11 @@ public class ApiManager SendNotificationMessageNewLine($"An error occurred while mapping the private port ({ApiConfiguration.PrivatePort}) to the public port ({ApiConfiguration.PublicPort})! Error message: {ex.Message}", NotificationMessageType.Error); return false; } + catch (SocketException ex) + { + SendNotificationMessageNewLine($"An error occurred while mapping the private port ({ApiConfiguration.PrivatePort}) to the public port ({ApiConfiguration.PublicPort})! Error message: {ex.Message}", NotificationMessageType.Error); + return false; + } } public static void ClosePorts()