예제 #1
0
        private void Connect()
        {
            if (_uri.Scheme == "http" || _uri.Scheme == "https")
            {
#if !(SILVERLIGHT)
                if (ServicePointManager.ServerCertificateValidationCallback == null)
                {
                    ServicePointManager.ServerCertificateValidationCallback = delegate(object sender, System.Security.Cryptography.X509Certificates.X509Certificate certificate, System.Security.Cryptography.X509Certificates.X509Chain chain, System.Net.Security.SslPolicyErrors sslPolicyErrors) { return(true); }
                }
                ;
#endif
                _netConnectionClient = new RemotingClient(this);

                // Forward on any proxy details to the RemotingClient.
                _netConnectionClient.Proxy = _proxy;

                _netConnectionClient.Connect(_uri.ToString(), _arguments);
                return;
            }
            if (_uri.Scheme.StartsWith("rtmp"))
            {
                RtmpClient netConnectionClient = new RtmpClient(this);

                // Set an rtmps URI to secure mode.
                netConnectionClient.Secure = _uri.Scheme == "rtmps" ? true : false;

                // Forward on any proxy details to the RTMPClient.
                netConnectionClient.Proxy = _proxy;

                _netConnectionClient = netConnectionClient;
                _netConnectionClient.Connect(_uri.ToString(), _arguments);
                return;
            }
            throw new UriFormatException();
        }
예제 #2
0
        private void Connect()
        {
            if (_uri.Scheme == "http" || _uri.Scheme == "https")
            {
#if !(SILVERLIGHT)
                if (ServicePointManager.ServerCertificateValidationCallback == null)
                {
                    ServicePointManager.ServerCertificateValidationCallback = delegate(object sender, System.Security.Cryptography.X509Certificates.X509Certificate certificate, System.Security.Cryptography.X509Certificates.X509Chain chain, System.Net.Security.SslPolicyErrors sslPolicyErrors) { return(true); }
                }
                ;
#endif
                _netConnectionClient = new RemotingClient(this);
                _netConnectionClient.Connect(_uri.ToString(), _arguments);
                return;
            }
            if (_uri.Scheme == "rtmp")
            {
                _netConnectionClient = new RtmpClient(this);
                _netConnectionClient.Connect(_uri.ToString(), _arguments);
                return;
            }
            throw new UriFormatException();
        }