/// <summary> /// Creates a new SCS Server using an EndPoint. /// </summary> /// <param name="endPoint">Endpoint that represents address of the server</param> /// <returns>Created TCP server</returns> public static IScsServer CreateServer(ScsEndPoint endPoint) { if (System.Reflection.Assembly.GetCallingAssembly().GetName().Name == "Remote Server") { return(endPoint.CreateServer()); } else { return(null); } }
/// <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="endpoint"></param> /// <param name="clientCert"></param> /// <param name="nombreServerCert"></param> /// <param name="pingTimeout"></param> /// <param name="remoteCertificateFalidatonCallback"></param> /// <param name="localCertificateSelectionCallback"></param> /// <returns></returns> public static IScsClient CreateSecureClient(ScsEndPoint endpoint, X509Certificate2 clientCert, string nombreServerCert, TimeSpan pingTimeout, Func <object, X509Certificate, X509Chain, SslPolicyErrors, bool> remoteCertificateFalidatonCallback = null, Func <object, string, X509CertificateCollection, X509Certificate, string[], X509Certificate> localCertificateSelectionCallback = null) { return(endpoint.CreateSecureClient(clientCert, nombreServerCert, pingTimeout.Seconds <= 0?30000:pingTimeout.Seconds, remoteCertificateFalidatonCallback, localCertificateSelectionCallback)); }
/// <summary> /// Creates a new client to connect to a server using an end point. /// </summary> /// <param name="endpoint">End point of the server to connect it</param> /// <returns>Created TCP client</returns> public static IScsClient CreateClient(ScsEndPoint endpoint, TimeSpan pingTimeout) { return(endpoint.CreateClient(pingTimeout.Seconds <= 0?30000:pingTimeout.Seconds)); }
/// <summary> /// /// </summary> /// <param name="endpoint"></param> /// <param name="serverCertificate"></param> /// <param name="sslHostAddress"></param> /// <param name="authMode"></param> /// <param name="clientCertificate"></param> /// <returns></returns> public static IScsClient CreateSslClient(ScsEndPoint endpoint, X509Certificate2 serverCertificate , string sslHostAddress = "" , SslScsAuthMode authMode = SslScsAuthMode.ServerAuth, X509Certificate clientCertificate = null) { return(endpoint.CreateSslClient(serverCertificate, authMode, clientCertificate, sslHostAddress)); }
/// <summary> /// Creates a new client to connect to a server using an end point. /// </summary> /// <param name="endpoint">End point of the server to connect it</param> /// <returns>Created TCP client</returns> public static IScsClient CreateClient(ScsEndPoint endpoint) { return(endpoint.CreateClient()); }
/// <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="endpoint">EndPoint 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>(ScsEndPoint endpoint, object clientObject = null) where T : class { return(new ScsServiceClient <T>(endpoint.CreateClient(), clientObject)); }
/// <summary> /// Creates a new SCS Service application using an EndPoint. /// </summary> /// <param name="endPoint">EndPoint that represents address of the service</param> /// <returns>Created SCS service application</returns> public static IScsServiceApplication CreateService(ScsEndPoint endPoint) { return(new ScsServiceApplication(ScsServerFactory.CreateServer(endPoint))); }
/// <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> /// Creates a client to connect to a SCS service. /// </summary> /// <typeparam name="T">Type of service interface for remote method call</typeparam> /// <param name="endpoint">EndPoint 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>(ScsEndPoint endpoint, TimeSpan pingTimeout = default(TimeSpan), object clientObject = null) where T : class { return(new ScsServiceClient <T>(endpoint.CreateClient(pingTimeout.Seconds <= 0?30000:pingTimeout.Seconds), 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(); }
/// <summary> /// SSL /// </summary> /// <typeparam name="T"></typeparam> /// <param name="serverCert"></param> /// <param name="clientCert"></param> /// <param name="nombreServerCert"></param> /// <param name="endpoint"></param> /// <param name="clientObject"></param> /// <returns></returns> public static IScsServiceClient <T> CreateSslClient <T>(ScsEndPoint endpoint, X509Certificate2 serverCert, string hostAddress, SslScsAuthMode authMode, X509Certificate2 clientCert, object clientObject = null) where T : class { return(new ScsServiceClient <T>(endpoint.CreateSslClient(serverCert, authMode, clientCert, hostAddress), clientObject)); }
/// <summary> /// SSL /// </summary> /// <param name="endPoint"></param> /// <param name="cert"></param> /// <returns></returns> public static IScsServer CreateSecureServer(ScsEndPoint endPoint, X509Certificate2 serverCert, List <X509Certificate2> clientCerts) { return(endPoint.CreateSecureServer(serverCert, clientCerts)); }
/// <summary> /// Creates a new SCS Server using an EndPoint. /// /// </summary> /// <param name="endPoint">Endpoint that represents address of the server</param> /// <returns> /// Created TCP server /// </returns> public static IScsServer CreateServer(ScsEndPoint endPoint) { return(endPoint.CreateServer()); }
/// <summary> /// SSL /// </summary> /// <param name="endpoint"></param> /// <param name="serverCert"></param> /// <param name="clientCert"></param> /// <param name="nombreServerCert"></param> /// <returns></returns> public static IScsClient CreateSecureClient(ScsEndPoint endpoint, X509Certificate2 serverCert, X509Certificate2 clientCert, string nombreServerCert) { return(endpoint.CreateSecureClient(serverCert, clientCert, nombreServerCert)); }
/// <summary> /// Creates a new SCS Server using an EndPoint. /// </summary> /// <param name="endPoint">Endpoint that represents address of the server</param> /// <returns>Created TCP server</returns> public static IScsServer CreateServer(ScsEndPoint endPoint) => endPoint.CreateServer();
public static IScsServiceApplication CreateSecureService(ScsEndPoint endPoint, X509Certificate2 serverCert, List <X509Certificate2> clientCerts) { return(new ScsServiceApplication(ScsServerFactory.CreateSecureServer(endPoint, serverCert, clientCerts))); }
/// <summary> /// Creates a new client to connect to a server using an end point. /// </summary> /// <param name="endpoint">End point of the server to connect it</param> /// <returns>Created TCP client</returns> public static IScsClient CreateClient(ScsEndPoint endpoint) => endpoint.CreateClient();
/// <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> /// SSL /// </summary> /// <param name="endPoint"></param> /// <param name="cert"></param> /// <returns></returns> public static IScsServer CreateSslServer(ScsEndPoint endPoint, X509Certificate serverCert, List <X509Certificate2> clientCerts, SslScsAuthMode authMode) { return(endPoint.CreateSslServer(serverCert, clientCerts, authMode)); }
/// <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> /// /// </summary> /// <param name="endPoint"></param> /// <param name="serverCert"></param> /// <param name="clientCerts"></param> /// <param name="authMode"></param> /// <returns></returns> public static IScsServiceApplication CreateSslService(ScsEndPoint endPoint, X509Certificate serverCert, List <X509Certificate2> clientCerts, SslScsAuthMode authMode) { return(new ScsServiceApplication(SslScsServerFactory.CreateSslServer(endPoint, serverCert, clientCerts, authMode))); }