AddListener() public method

public AddListener ( DiscoveryClientListener newListener ) : void
newListener DiscoveryClientListener
return void
Exemplo n.º 1
0
        private void AutoDiscoverInit()
        {
            discoveryClientAdapter = new DiscoveryClientAdapter();
            discoveryClientAdapter.DiscoveredEvent += OnSystemDiscovered;

            discoveryClient = DiscoveryClient.Create();
            discoveryClient.AddListener(discoveryClientAdapter);

            //Start Finding Server
            isTryingToFindServer = true;
        }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
        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();
        }