예제 #1
0
        public void Setup()
        {
            // Start Scripting-REST-API-Server
            var serverExecutable = new FileInfo(SERVER_EXECUTABLE_PATH_LINUX);

            Assert.True(serverExecutable.Exists);
            _serverProcess = new Process();
            _serverProcess.StartInfo.FileName         = serverExecutable.FullName;
            _serverProcess.StartInfo.Arguments        = SERVER_CMD_LINE_ARGS;
            _serverProcess.StartInfo.WorkingDirectory = serverExecutable.Directory.FullName;

            _serverProcess.Start();

            //wait until server starts
            Console.Write("Waiting 5 Seconds for REST-API-Server to start");
            for (int i = 0; i < 5; i++)
            {
                Thread.Sleep(1000);
                Console.Write(".");
            }
            Console.WriteLine();

            // Logging:
            var loggerFactory = LoggerFactory.Create(builder =>
            {
                builder.AddFilter("Default", LogLevel.Debug).AddConsole();
            });
            var logger = loggerFactory.CreateLogger <RemoteScriptRunner>();

            _scriptRunner = new RemoteScriptRunner(logger);
            _scriptRunner.SetIpAddressAndPort(SERVER_IP, Convert.ToUInt16(SERVER_PORT));
        }
예제 #2
0
        //#####################################################################
        // Implementation of the interface
        // - manage local and remote screen-resolutions
        //#####################################################################
        #region

        /// <see cref="IWDClientServices.ConnectToServer" ></see>
        async Task IWDClientServices.ConnectToServer(string ipAddress, UInt16 port)
        {
            _remoteScriptRunner.SetIpAddressAndPort(ipAddress, port);
            await((IWDClientServices)this).GetInitalRemoteScreenResolution();
        }