예제 #1
0
 /// <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);
     }
 }
예제 #2
0
 /// <summary>
 /// SSL
 /// </summary>
 /// <param name="endpointAddress"></param>
 /// <returns></returns>
 public static IScsClient CreateSecureClient(string endpointAddress, TimeSpan pingTimeout)
 {
     return(CreateClient(ScsEndPoint.CreateEndPoint(endpointAddress), pingTimeout));
 }
예제 #3
0
 /// <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));
 }
예제 #4
0
 /// <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));
 }
예제 #5
0
 /// <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));
 }
예제 #6
0
 /// <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());
 }
예제 #7
0
 /// <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));
 }
예제 #8
0
 /// <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)));
 }
예제 #9
0
 /// <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));
 }
예제 #10
0
 /// <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));
 }
예제 #11
0
 /// <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));
 }
예제 #12
0
 /// <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));
 }
예제 #13
0
 public void Connect()
 {
     _client               = ScsServiceClientBuilder.CreateClient <INDistManagementService>(ScsEndPoint.CreateEndPoint(Address), _serverListener);
     _client.Connected    += Client_Connected;
     _client.Disconnected += Client_Disconnected;
     _client.Connect();
 }
예제 #14
0
 /// <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));
 }
예제 #15
0
 /// <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));
 }
예제 #16
0
 /// <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());
 }
예제 #17
0
 /// <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));
 }
예제 #18
0
 /// <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();
예제 #19
0
 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();
예제 #21
0
 /// <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));
 }
예제 #22
0
 /// <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));
 }
예제 #23
0
 /// <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)));
 }
예제 #24
0
 /// <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)));
 }