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()