     func flushFromEventLoop() {
         assert(open)
 
-        if flushNow() {
+        // This flush is triggered by the EventLoop which means it should only try to write the messages that were marked as flushed before
+        if flushNow(markFlushCheckpoint: false) {
             // 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)
             

            return
        }
        
        if !flushNow() {
            guard open else {
                return
            }

        head = pending.next
        if head == nil {
            tail = nil
            flushCheckpoint = nil
        }
    }
    
    private func isFlushCheckpoint(_ pending: PendingWrite) -> Bool {
        return pending === flushCheckpoint
    }
    
    private func checkFlushCheckpoint(pending: PendingWrite) -> Bool {
        if isFlushCheckpoint(pending) {
            flushCheckpoint = nil
            return true
        }
        return false
    }
    
    private func isFlushPending() -> Bool {
        return flushCheckpoint != nil
    }
    
    private func consumeOne(body: (UnsafePointer<UInt8>, Int) throws -> Int?) rethrows -> Bool? {
        if let pending = head, isFlushPending() {
            if let written = try pending.buffer.withReadPointer(body: body) {
                outstanding -= UInt64(written)
                
