         return head?.next != nil
     }
     
+    func markFlushCheckpoint() {
+        flushCheckpoint = tail
+    }
+    
     /*
      Function that takes two closures and based on if there are more then one ByteBuffer pending calls either one or the other.
     */
     func consume(oneBody: (UnsafePointer<UInt8>, Int) throws -> Int?, multipleBody: ([(UnsafePointer<UInt8>, Int)]) throws -> Int?) rethrows -> Bool? {
+        
         if hasMultiple {
             // Holds multiple pending writes, use consumeMultiple which will allow us to us writev (a.k.a gathering writes)
             return try consumeMultiple(body: multipleBody)

    func flushFromEventLoop() {
        assert(open)

        if flushNow() {
            // Everything was written, reregister again with InterestedEvent.Read so we are notified once there is more data on the socketto read.
            pipeline.fireChannelWritabilityChanged(writable: true)
            

                    }
                }
                
                if (isEmpty || allFlushed) {
                    // return nil to signal to the caller that there are no more buffers to consume
                    return nil
                }
