mirror of
https://github.com/Stone-Red-Code/HyperbolicDownloader.git
synced 2026-09-04 00:56:09 +02:00
Add response to discover command.
This commit is contained in:
@@ -19,8 +19,13 @@ public class HostCommands
|
||||
public void Discover(string _)
|
||||
{
|
||||
ApiManager.SendNotificationMessageNewLine("Running local discovery routine...", NotificationMessageType.Info);
|
||||
|
||||
int hostsCountBefore = hostsManager.Count;
|
||||
|
||||
BroadcastClient.Send(ApiConfiguration.BroadcastPort, ApiConfiguration.PrivatePort.ToString());
|
||||
Thread.Sleep(3000);
|
||||
|
||||
ApiManager.SendNotificationMessageNewLine($"Found {hostsManager.Count - hostsCountBefore} host(s)", NotificationMessageType.Info);
|
||||
}
|
||||
|
||||
public void CheckActiveHosts(string _)
|
||||
|
||||
@@ -149,7 +149,7 @@ public class ApiManager
|
||||
return;
|
||||
}
|
||||
|
||||
_ = hostsToSend.RemoveAll(x => x.IPAddress == recivedEventArgs.IPEndPoint.Address.ToString());
|
||||
_ = hostsToSend.RemoveAll(x => x.IPAddress == remoteIpAddress.ToString());
|
||||
hostsToSend.Add(localSocket);
|
||||
|
||||
bool success = int.TryParse(recivedEventArgs.Message, out int remotePort);
|
||||
|
||||
Reference in New Issue
Block a user