anchor.diff:     (bytes-written :initform 0 :accessor socket-bytes-written)
      (external-format-in :initarg :external-format-in :reader socket-external-format-in)
      (external-format-out :initarg :external-format-out :reader socket-external-format-out)
  -   (binary-p :initarg :binaryp :accessor socket-binary-p)))
  +   (binary-p :initarg :binaryp :accessor socket-binary-p)
  +   (close-after-drain-p :initform nil :accessor socket-close-after-drain-p)))
   (defun make-socket (driver &key
                       (buffer-size *max-buffer-size*)
                       (external-format-in *default-external-format*)
  
positive.code:                     SOCKET-EXTERNAL-FORMAT-OUT will only be used when converting input strings for
                      output -- binary input data (as through WRITE-SEQUENCE) will not be
                      converted. SOCKET-EXTERNAL-FORMAT-IN is not used at all in binary mode.
                      This value can be changed after a socket has already been created."))
    (:prefix socket-))
  
  ;;; Implementation
  
negative.code:                             (length (socket-write-buffer socket)))
                      (setf (socket-write-buffer socket) nil)
                      (when (queue-empty-p (socket-write-queue socket))
                        (if (socket-close-after-drain-p socket)
                            (finish-close socket)
                            (on-socket-output-empty driver socket)))))
                (continue () nil)
                (drop-connection () (close socket :abort t)))))
          (when (queue-empty-p (socket-write-queue socket))
  