anchor.diff:  (defun finish-close (socket)
     (when-let (evbase (and (slot-boundp socket 'internal-socket)
                            (socket-event-base socket)))
  -    (iolib:remove-fd-handlers evbase
  -                             (iolib:socket-os-fd (socket-internal-socket socket))
  -                             :write t)
  +    (pause-writes socket)
       (when-let (server (socket-server socket))
         (remhash socket (server-connections server)))
       (close (socket-internal-socket socket) :abort t)
  
positive.code:    (close-after-drain-p ((socket a))
      :accessorp t
      :documentation "When true, the internal socket will be closed once the socket's output buffer is
                      drained."))
    (:prefix socket-))
  
  ;;; Implementation
  
negative.code:   (or *event-base*
        (error "Operation not supported outside of the scope of WITH-EVENT-LOOP.")))
  
  (defun socket-enqueue (sequence socket)
    (enqueue sequence (socket-write-queue socket))
    (start-writes socket))
  
  ;;; Gray streams implementation
  (defmethod stream-write-sequence ((socket socket) sequence start end &key)
    (socket-enqueue (subseq sequence (or start 0) (or end (length sequence)))
                    socket))
  (defmethod stream-line-column ((socket socket))
    ;; TODO
    0)
  (defmethod stream-write-char ((socket socket) character)
    ;; TODO - Meh. Maybe a buffer for very short messages or something?
    (socket-enqueue (make-string 1 :initial-element character) socket))
  (defmethod stream-write-byte ((socket socket) byte)
    (socket-enqueue (make-array 1 :element-type 'flex:octet :initial-element byte) socket))
  (defmethod stream-write-string ((socket socket) string &optional start end)
    (stream-write-sequence socket string start end))
  (defmethod close ((socket socket) &key abort)
    (when-let (evbase (and (slot-boundp socket 'internal-socket)
                           (socket-event-base socket)))
      (socket-pause socket)
      (cond (abort
             (finish-close socket))
            (t
  