Beispiel #1
0
        public static string scrambleAPI(INetQuery query)
        {
            IURLMangling iurlmangling = query as IURLMangling;
            string       text         = iurlmangling.Safix;

            if (string.IsNullOrEmpty(text))
            {
                text = Cryptography.Instance.scramble(query.URL);
                APIInitializer.setSafix(iurlmangling, text);
            }
            return(text);
        }
Beispiel #2
0
        protected bool create(INetQuery query)
        {
            OperationManager instance = Singleton <OperationManager> .instance;
            string           baseUri  = instance.getBaseUri();
            string           apiName  = (0 < NetConfig.EncryptVersion) ? Packet.scrambleAPI(query) : query.URL;

            this.query_      = query;
            this.client_     = NetWebClient.Create(baseUri + apiName, NetConfig.EncryptVersion, NetConfig.UseTLS);
            this.retryCount_ = 0;
            this.time_       = 0f;
            if (this.client_ != null)
            {
                this.client_.TimeOutInMSec = NetConfig.TimeOutInMSec;
                this.state_  = Packet.State.Ready;
                this.status_ = Packet.Status.OK;
                return(true);
            }
            this.state_  = Packet.State.Error;
            this.status_ = Packet.Status.Error_Create;
            return(false);
        }