Builderdash.JobServiceProxy.GetService C# (CSharp) Method

GetService() public method

public GetService ( ) : ServiceClientWrapper
return ServiceClientWrapper
        public ServiceClientWrapper<IJobService> GetService()
        {
            NetTcpBinding binding;
            EndpointAddress remoteAddress;
            X509Certificate2 clientCertificate = null;
            X509CertificateValidator certificateValidator = null;

            if (_serverMode == ServerMode.Secure)
            {
                binding = GetSecureBinding();
                remoteAddress = new EndpointAddress(_uri,
                                           EndpointIdentity.CreateDnsIdentity(_masterCommonName),
                                           (AddressHeaderCollection)null);

                clientCertificate = LoadFromFile();
                certificateValidator = new ServerX509CertificateValidator(_caCertificate);
            }
            else
            {
                binding = GetBinding();
                remoteAddress = new EndpointAddress(_uri);
            }

            return new ServiceClientWrapper<IJobService>(binding,
                    remoteAddress,
                    new CallbackImpl(),
                    certificateValidator,
                    clientCertificate);
        }