anchor.diff:                               (setf delay nil
                                      (write-callback client) nil
                                      (write-finished-promise client) nil)
  -                             (%disconnect client)
                                (let ((condition (make-condition 'mqtt-error
                                                                 :format-control "Timed out writing message: ~s"
                                                                 :format-arguments (list message))))
  -                               (handle-connection-error client condition)
  +                               (unless (as:streamish-closed-p (socket client))
  +                                 ;; the error is expected if the socket is closed
  +                                 (handle-connection-error client condition))
                                  (reject condition))))
                        (%send-message client message)))))
             (if (or (null (write-finished-promise client))
  
positive.code:         (flet ((actually-send ()
                   (let (delay)
                     (bb:with-promise (resolve reject :name "SEND-MESSAGE-PROMISE")
                       (setf (write-callback client)
                             #'(lambda ()
                                 (when delay
  
negative.code:     (setf error (make-condition 'mqtt-error
                                  :format-control error
                                  :format-arguments args)))
    (unless (as:streamish-closed-p (socket client))
      (%disconnect client)
      (when (error-handler client)
        (funcall (error-handler client) error)))
    error)
  
  (defun push-message-handler (client match callback &key permanent-p)
  