Example #1
0
        public HttpManager Setup(HttpSettings httpSettings = null)
        {
            this.settings = (httpSettings ?? new HttpSettings()).FillWithDefaults();

            string dataPath = string.Concat(settings.dataDirectory, "/", GetType().Namespace);

            Directory.CreateDirectory(dataPath);

            this.streamPool   = new StreamPool(settings);
            this.cookieJar    = new CookieJar(settings.fileHandler, dataPath);
            this.cacheHandler = new CacheHandler(settings.fileHandler, dataPath);
            this.messenger    = new Messenger(settings, streamPool, cacheHandler, cookieJar);

            this.ongoingRequests = new List <DispatchInfo>();
            this.pendingRequests = new Queue <DispatchInfo>();
            this.mainThreadQueue = new Queue <Action>();
            this.deltaTimer      = 0f;

            UserAgent.Build();

            return(this);
        }
Example #2
0
 internal ResponseHandler(HttpSettings settings, CookieJar cookieJar, CacheHandler cacheHandler)
 {
     this.settings     = settings;
     this.cookieJar    = cookieJar;
     this.cacheHandler = cacheHandler;
 }
Example #3
0
 internal Messenger(HttpSettings settings, StreamPool streamPool, CacheHandler cacheHandler, CookieJar cookieJar)
 {
     this.settings        = settings;
     this.streamPool      = streamPool;
     this.requestHandler  = new RequestHandler(settings, cookieJar, cacheHandler);
     this.responseHandler = new ResponseHandler(settings, cookieJar, cacheHandler);
 }