Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Threema/ThreemaFramework/Core/   (Social Medium ©)  Datei vom 26.9.2026 mit Größe 1 kB image not shown  

Quelle  DefaultURLSessionProvider.swift   Sprache: JAVA

 

import Foundation

final class DefaultURLSessionProvider: URLSessionProvider {
    func defaultSession(delegate: URLSessionDelegate?) -> URLSession {
        // We first need to create the configuration. Changes made to a session after its initialization are not
        // respected.
        let configuration = URLSessionConfiguration.ephemeral

        // General
        configuration.allowsCellularAccess = true
        
        // Should this be enabled?
        // configuration.waitsForConnectivity = true
        
        // Caching, this might not be needed since configuration is ephemeral anyways
        configuration.urlCache = nil
        configuration.urlCredentialStorage = nil

        if let delegate {
            return URLSession(
                configuration: configuration,
                delegate: delegate,
                delegateQueue: OperationQueue.current
            )
        }
        else {
            return URLSession(configuration: configuration)
        }
    }

    func backgroundSession(identifier: String, delegate: URLSessionDelegate) -> URLSession {
        // We first need to create the configuration. Changes made to a session after its initialization are not
        // respected.
        let configuration = URLSessionConfiguration.background(withIdentifier: identifier)

        // General
        configuration.allowsCellularAccess = true
        configuration.waitsForConnectivity = true
        
        // Caching, this might not be needed since configuration is ephemeral anyways
        configuration.urlCache = nil
        configuration.urlCredentialStorage = nil

        return URLSession(
            configuration: configuration,
            delegate: delegate,
            delegateQueue: .current
        )
    }
}

Messung
CHZG
959410096

¤ Dauer der Verarbeitung: 0.4 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover


Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.