Пример #1
0
        public static VcRemoteClient GetInstance(IOSLaunchOptions options)
        {
            VcRemoteClient client = null;
            string baseAddressFormat = string.Empty;
            if (options.Secure)
            {
                var handler = new RequestAuthHandler();
                client = new VcRemoteClient(handler);
                client.ServerCertificateValidationCallback = handler.ServerCertificateValidationCallback;
                baseAddressFormat = @"https://{0}:{1}/";
            }
            else
            {
                client = new VcRemoteClient();
                baseAddressFormat = @"http://{0}:{1}/";
            }
            client.BaseAddress = new Uri(string.Format(CultureInfo.InvariantCulture, baseAddressFormat, options.RemoteMachineName, options.VcRemotePort));
            client.Timeout = new TimeSpan(0, 0, 10); //10 second timeout
            client.Secure = options.Secure;
            client._launchOptions = options;

            return client;
        }
Пример #2
0
        public static VcRemoteClient GetInstance(IOSLaunchOptions options)
        {
            VcRemoteClient client            = null;
            string         baseAddressFormat = string.Empty;

            if (options.Secure)
            {
                var handler = new RequestAuthHandler();
                client = new VcRemoteClient(handler);
                client.ServerCertificateValidationCallback = handler.ServerCertificateValidationCallback;
                baseAddressFormat = @"https://{0}:{1}/";
            }
            else
            {
                client            = new VcRemoteClient();
                baseAddressFormat = @"http://{0}:{1}/";
            }
            client.BaseAddress    = new Uri(string.Format(CultureInfo.InvariantCulture, baseAddressFormat, options.RemoteMachineName, options.VcRemotePort));
            client.Timeout        = new TimeSpan(0, 0, 10); //10 second timeout
            client.Secure         = options.Secure;
            client._launchOptions = options;

            return(client);
        }