コード例 #1
0
        public HttpTransferManager(AppleLifecycle lifecycle,
                                   ILogger <IHttpTransferManager> logger,
                                   IPlatform platform,
                                   int maxConnectionsPerHost = 1)
        {
            this.platform = platform;
            this.logger   = logger;

            this.sessionDelegate = new ShinyUrlSessionDelegate(this, logger, platform);
            this.sessionConfig   = NSUrlSessionConfiguration.CreateBackgroundSessionConfiguration(SessionName);
            this.sessionConfig.HttpMaximumConnectionsPerHost = maxConnectionsPerHost;
            this.sessionConfig.RequestCachePolicy            = NSUrlRequestCachePolicy.ReloadIgnoringLocalAndRemoteCacheData;

            var s = this.Session; // force load

            lifecycle.RegisterHandleEventsForBackgroundUrl((sessionIdentifier, completionHandler) =>
            {
                if (!SessionName.Equals(sessionIdentifier))
                {
                    return(false);
                }

                ShinyUrlSessionDelegate.CompletionHandler = completionHandler;
                return(true);
            });
        }
コード例 #2
0
ファイル: HttpTransferManager.cs プロジェクト: tuaasn/shiny
        public HttpTransferManager(int maxConnectionsPerHost = 1)
        {
            this.sessionDelegate = new ShinyUrlSessionDelegate(this);
            this.sessionConfig   = NSUrlSessionConfiguration.CreateBackgroundSessionConfiguration(SessionName);
            this.sessionConfig.HttpMaximumConnectionsPerHost = maxConnectionsPerHost;
            this.sessionConfig.RequestCachePolicy            = NSUrlRequestCachePolicy.ReloadIgnoringLocalAndRemoteCacheData;

            var s = this.Session; // force load
        }
コード例 #3
0
        public HttpTransferManager(int maxConnectionsPerHost = 1)
        {
            this.sessionDelegate = new ShinyUrlSessionDelegate(this);
            this.sessionConfig   = NSUrlSessionConfiguration.CreateBackgroundSessionConfiguration(SessionName);
            this.sessionConfig.HttpMaximumConnectionsPerHost = maxConnectionsPerHost;
            this.sessionConfig.RequestCachePolicy            = NSUrlRequestCachePolicy.ReloadIgnoringLocalAndRemoteCacheData;

            var s = this.Session; // force load
            //this.sessionConfig.Discretionary = true;
            //this.sessionConfig.HttpShouldUsePipelining = true;
            //this.sessionConfig.RequestCachePolicy = NSUrlRequestCachePolicy.ReloadIgnoringCacheData;
            //this.sessionConfig.ShouldUseExtendedBackgroundIdleMode = true;
        }