Ejemplo n.º 1
0
        public void Init(string baseUrl, string baseDir, ScoutViewOfPlatform platform, VLogger logger)
        {
            this.baseUrl = baseUrl;
            this.platform = platform;
            this.logger = logger;

            scoutService = new ValveScoutService(baseUrl + "/webapp", this, platform, logger);

            appServer = new WebFileServer(baseDir, baseUrl, logger);

            //IPEndPoint endpoint = new IPEndPoint(IPAddress.Any, listenPortNumber);
            //listenClient = new UdpClient(endpoint);

            //listenClient.Client.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.PacketInformation, true);
            //listenClient.Client.BeginReceiveMessageFrom(asyncBuffer, 0, 2000, asyncSocketFlags, ref asyncRemoteEndPoint, new AsyncCallback(ReceiveCallback), null);

            //create a time that fires ScanNow() periodically
            var scanTimer = new Timer(ScoutHelper.DefaultDeviceDiscoveryPeriodSec * 1000);
            scanTimer.Enabled = true;
            scanTimer.Elapsed += new ElapsedEventHandler(ScanNow);

            logger.Log("ValveScout initialized");
        }
Ejemplo n.º 2
0
        public void Init(string baseUrl, string baseDir, ScoutViewOfPlatform platform, VLogger logger)
        {
            this.baseUrl  = baseUrl;
            this.platform = platform;
            this.logger   = logger;

            scoutService = new ValveScoutService(baseUrl + "/webapp", this, platform, logger);

            appServer = new WebFileServer(baseDir, baseUrl, logger);

            //IPEndPoint endpoint = new IPEndPoint(IPAddress.Any, listenPortNumber);
            //listenClient = new UdpClient(endpoint);

            //listenClient.Client.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.PacketInformation, true);
            //listenClient.Client.BeginReceiveMessageFrom(asyncBuffer, 0, 2000, asyncSocketFlags, ref asyncRemoteEndPoint, new AsyncCallback(ReceiveCallback), null);

            //create a time that fires ScanNow() periodically
            var scanTimer = new Timer(ScoutHelper.DefaultDeviceDiscoveryPeriodSec * 1000);

            scanTimer.Enabled  = true;
            scanTimer.Elapsed += new ElapsedEventHandler(ScanNow);

            logger.Log("ValveScout initialized");
        }