Ejemplo n.º 1
0
        public static ContactEndpoint ResolveIdentity(string identity)
        {
            // pattern: "https://" + Address + ":" + Port.ToString() + "/" + Path;

            string decrypted = Tools.Instance.Cryptography.TrippleDESDecrypt(identity, true);
            Uri uri = new Uri(decrypted, UriKind.Absolute);

            string host = uri.Host;
            int port = uri.Port;
            string path = uri.AbsolutePath;
            
            ContactEndpoint endpoint = new ContactEndpoint(host, port, path);

            return endpoint;
        }
Ejemplo n.º 2
0
 public ServerController(ContactEndpoint endpoint, string identity, ControllerEventHandlers handlers, bool isSecured)
 {
     try
     {
         _isSecured = isSecured;
         _myEndpoint = endpoint;
         if (endpoint.Port != 0)
         {
             _address = "https://" + endpoint.Address + ":" + (endpoint.Port + 1).ToString() + endpoint.Path;
         }
         else
         {
             _address = "https://" + endpoint.Address + endpoint.Path;
         }
         Builder serverBuilder = new ServerBuilder(_address, handlers, identity, isSecured);
         Director.Instance.Construct(serverBuilder);
         _server = (ServiceHost)serverBuilder.GetResult();
     }
     catch (Exception ex)
     {
         Tools.Instance.Logger.LogError(ex.ToString());
     }
 }
Ejemplo n.º 3
0
 public ClientBuilder(ContactEndpoint serverEndpoint, bool isSecured)
 {
     _endpoint = serverEndpoint;
     _client = new WCFClient(isSecured);
     _isSecured = isSecured;
 }