         socket: L2CAPSocket,
         maximumTransmissionUnit: ATTMaximumTransmissionUnit,
         callback: GATTClientConnectionCallback
-    ) {
+    ) async {
         self.peripheral = peripheral
         self.callback = callback
-        self.client = GATTClient(
+        self.client = await GATTClient(
             socket: socket,
             maximumTransmissionUnit: maximumTransmissionUnit,
-            log: { callback.log?("[\(peripheral)]: " + $0) },
+            log: { callback.log?("[\(peripheral)]: " + $0) }
         )
-        /*
-        self.client.writePending = { [weak self] in
-            guard let self = self else { return }
-            Task(priority: .userInitiated) {
-                do {
-                    var didWrite = true
-                    repeat {
-                        didWrite = try await self.client.write()
-                    } while didWrite
-                }
-                catch {
-                    
-                }
-            }
-        }*/
     }
     
     // MARK: - Methods

                       characteristics: Array(gattService.characteristics.values.map { $0.attribute }))
        
        // GATT request
        let foundDescriptors = try await client.discoverDescriptors(for: gattCharacteristic.attribute, service: service)
        
        // update cache
        cache.insert(foundDescriptors, for: characteristic.id)

    
    public private(set) var error: Swift.Error?
    
    internal private(set) var cache = GATTClientConnectionCache()
    
    internal func maximumUpdateValueLength() async -> Int {
        // ATT_MTU-3
        return await Int(client.maximumTransmissionUnit.rawValue) - 3
    }
    
    // MARK: - Initialization
