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