         curlHelperSetOptBool(handle, CURLOPT_POST, CURL_TRUE)
         
         // Pipeline
-        // Apples APNS server don't support pipelining yet.
-//        curlHelperSetOptInt(handle, CURLOPT_PIPEWAIT, 1)
+        curlHelperSetOptInt(handle, CURLOPT_PIPEWAIT, 1)
         
         // setup payload
         

    
    private let performQueue: DispatchQueue = DispatchQueue(label: "VaporAPNS.curl_multi_perform")
    
    private var runningConnectionsCount: Int32 = 0
    
    private var repeats = 0
    
    /// Core cURL-multi Loop is done here
    private func performActiveConnections() {
        var runningCount: Int32 = 0
        
        var code: CURLMcode = CURLM_OK
        code = curl_multi_perform(self.curlHandle, &runningCount)
        
        performQueue.async {
            var numfds: Int32 = 0
            
            if code == CURLM_OK {
                code = curl_multi_wait(self.curlHandle, nil, 0, 1000, &numfds);
            }
            if code != CURLM_OK {
                print("curl_multi_wait failed with error code \(code)")
                return
            }
            
            if numfds != 0 {
                self.repeats += 1
            } else {
                self.repeats = 0
            }
            
            code = curl_multi_perform(self.curlHandle, &runningCount)
            
            if runningCount < self.runningConnectionsCount {
                
                var numMessages: Int32 = 0
                var curlMessage: UnsafeMutablePointer<CURLMsg>?
                
                repeat {
                    curlMessage = curl_multi_info_read(self.curlHandle, &numMessages)
                    if let message = curlMessage {
                        let handle = message.pointee.easy_handle
                        let msg = message.pointee.msg
                        
                        if msg == CURLMSG_DONE {
                            
                            var doneConnection: Connection?
                            self.connectionQueue.sync {
                                if let item = self.connections.first(where: { item in
                                    guard let connection = item as? Connection else { return false }
                                    return handle == connection.handle
                                }),
                                    let connection = item as? Connection
                                {
                                    doneConnection = connection
                                } else {
                                    doneConnection = nil
                                }
                            }
                            if let connection = doneConnection {
                                self.complete(connection: connection)
                            } else {
                                print("Warning: Removing handle not in connection list")
                                curl_multi_remove_handle(self.curlHandle, handle)
                            }
                            
                        } else {
                            print("MSG: \(msg.rawValue)")
                        }
                    }
                    
                } while curlMessage != nil
            }
            self.runningConnectionsCount = runningCount
            
            if self.runningConnectionsCount > 0 {
                if self.repeats > 1 {
                    self.performQueue.asyncAfter(deadline: DispatchTime.now() + 0.1) {
                        self.performActiveConnections()

    }
    
    // MARK: CURL Config
    
    private func configureCurlHandle(for message: ApplePushMessage,
                                     to deviceToken: String,
