/// <summary> /// Creates a client to connect to a SCS service. /// </summary> /// <typeparam name="T">Type of service interface for remote method call</typeparam> /// <param name="endpointAddress">EndPoint address of the server</param> /// <param name="clientObject">Client-side object that handles remote method calls from server to client. /// May be null if client has no methods to be invoked by server</param> /// <returns>Created client object to connect to the server</returns> public static IScsServiceClient <T> CreateClient <T>(string endpointAddress, object clientObject = null) where T : class { return(CreateClient <T>(ScsEndPoint.CreateEndPoint(endpointAddress), clientObject)); }
/// <summary> /// Creates a new client to connect to a server using an end point. /// </summary> /// <param name="endpointAddress">End point address of the server to connect it</param> /// <returns>Created TCP client</returns> public static IScsClient CreateClient(string endpointAddress) { return(CreateClient(ScsEndPoint.CreateEndPoint(endpointAddress))); }
/// <summary> /// SSL /// </summary> /// <param name="endpointAddress"></param> /// <returns></returns> public static IScsClient CreateSecureClient(string endpointAddress, TimeSpan pingTimeout) { return(CreateClient(ScsEndPoint.CreateEndPoint(endpointAddress), pingTimeout)); }
/// <summary> /// /// </summary> /// <param name="clientCert"></param> /// <param name="nombreServerCert"></param> /// <param name="endpointAddress"></param> /// <param name="pingTimeout"></param> /// <param name="remoteCertificateFalidatonCallback"></param> /// <param name="localCertificateSelectionCallback"></param> /// <param name="clientObject"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public static IScsServiceClient <T> CreateSecureClient <T>(X509Certificate2Collection clientCert, string nombreServerCert, string endpointAddress, TimeSpan pingTimeout = default(TimeSpan), Func <object, X509Certificate, X509Chain, SslPolicyErrors, bool> remoteCertificateFalidatonCallback = null, Func <object, string, X509CertificateCollection, X509Certificate, string[], X509Certificate> localCertificateSelectionCallback = null, object clientObject = null) where T : class { return(CreateSecureClient <T>(clientCert, nombreServerCert, ScsEndPoint.CreateEndPoint(endpointAddress), pingTimeout, remoteCertificateFalidatonCallback, localCertificateSelectionCallback, clientObject)); }
/// <summary> /// Creates a client to connect to a SCS service. /// </summary> /// <typeparam name="T">Type of service interface for remote method call</typeparam> /// <param name="endpointAddress">EndPoint address of the server</param> /// <param name="clientObject">Client-side object that handles remote method calls from server to client. /// May be null if client has no methods to be invoked by server</param> /// <returns>Created client object to connect to the server</returns> public static IScsServiceClient <T> CreateClient <T>(string endpointAddress, TimeSpan pingTimeout = default(TimeSpan), object clientObject = null) where T : class { return(CreateClient <T>(ScsEndPoint.CreateEndPoint(endpointAddress), pingTimeout, clientObject)); }
/// <summary> /// SSL /// </summary> /// <typeparam name="T"></typeparam> /// <param name="serverCert"></param> /// <param name="clientCert"></param> /// <param name="nombreServerCert"></param> /// <param name="endpointAddress"></param> /// <param name="clientObject"></param> /// <returns></returns> public static IScsServiceClient <T> CreateSecureClient <T>(X509Certificate2 serverCert, X509Certificate2 clientCert, string nombreServerCert, string endpointAddress, object clientObject = null) where T : class { return(CreateSecureClient <T>(serverCert, clientCert, nombreServerCert, ScsEndPoint.CreateEndPoint(endpointAddress), clientObject)); }
public void Connect() { _client = ScsServiceClientBuilder.CreateClient <INDistManagementService>(ScsEndPoint.CreateEndPoint(Address), _serverListener); _client.Connected += Client_Connected; _client.Disconnected += Client_Disconnected; _client.Connect(); }