private void AutoDiscoverUpdate() { //Searching Enabled-> Update DiscoveryClient to check results, Wait Interval then Ping network. pingIntervalCurrent += Time.deltaTime; if (pingIntervalCurrent > PingIntervalSec) { pingIntervalCurrent = 0; discoveryClient.Ping(); } discoveryClient.Update(); }
private void AutoDiscoverUpdate() { //Searching Enabled-> Update DiscoveryClient to check results, Wait Interval then Ping network. pingIntervalCurrent += Time.deltaTime; if (pingIntervalCurrent > PingIntervalSec) { if (ShowDetailedLogs) { Debug.Log("Looking for servers..."); } pingIntervalCurrent = 0; discoveryClient.Ping(); } discoveryClient.Update(); }
private readonly int pingRefreshRate = 2; // seconds public AddAppDialog() { InitializeComponent(); listener = new DiscoveryClientAdapter(); listener.DiscoveredEvent += OnSystemDiscovered; listener.LostEvent += OnSystemLost; discoveryClient = DiscoveryClient.Create(); discoveryClient.AddListener(listener); discoveryClient.Ping(); updateTimer = new DispatcherTimer(); updateTimer.Tick += UpdateDiscoveredApps; updateTimer.Interval = new TimeSpan(0, 0, 0, 0, 1000 / 30); // 30 updates per second updateTimer.Start(); refreshTimer = new DispatcherTimer(); refreshTimer.Tick += RefreshPing; refreshTimer.Interval = new TimeSpan(0, 0, 0, pingRefreshRate, 0); refreshTimer.Start(); }