private void AutoDiscoverInit() { discoveryClientAdapter = new DiscoveryClientAdapter(); discoveryClientAdapter.DiscoveredEvent += OnSystemDiscovered; discoveryClient = DiscoveryClient.Create(); discoveryClient.AddListener(discoveryClientAdapter); //Start Finding Server isTryingToFindServer = true; }
private void AutoDiscoverInit() { if (ShowDetailedLogs) { Debug.Log("Looking for servers..."); } discoveryClientAdapter = new DiscoveryClientAdapter(); discoveryClientAdapter.DiscoveredEvent += OnSystemDiscovered; discoveryClient = DiscoveryClient.Create(); discoveryClient.AddListener(discoveryClientAdapter); //Start Finding Server isTryingToFindServer = true; }
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(); }