anchor.diff:                (progn
                   (when connect-cb
                     (funcall connect-cb (or stream socket)))
  +                ;; write any buffered output we've stored up
                   (write-pending-socket-data socket))
                 (run-event-cb 'event-handler res event-cb :socket socket)))))))
   
  
positive.code: 
  (defun write-to-uvstream (uvstream data)
    "Util function to write data directly to a uv stream object."
    (let* ((data (if (stringp data)
                     (babel:string-to-octets data :encoding :utf-8)
                     data))
           (data-length (length data))
           (data-index 0)
           (buffer-c *output-buffer*)
           (buffer-length (length buffer-c)))
  
negative.code:                     ;; usual. if not connected, buffer the write in the socket's
                      ;; write buffer until connected
                      (if (socket-connected socket)
                          ;; buffer the socket data until the next event loop.
                          ;; this avoids multiple (unneccesary) calls to uv_write,
                          ;; which is fairly slow
                          (let ((data (if (stringp data)
                                          (babel:string-to-octets data :encoding :utf-8)
                                          data)))
                            (write-sequence data (socket-buffer socket))
                            (unless (socket-buffering-p socket)
                              (setf (socket-buffering-p socket) t)
                              ;; flush the socket's buffer on the next loop
                              (as:with-delay ()
                                (setf (socket-buffering-p socket) nil)
                                (write-to-uvstream uvstream (flexi-streams:get-output-stream-sequence (socket-buffer socket))))))
                          ;; the socket isn't connected yet. libuv is suppoers to
                          ;; queue the writes until it connects, but it doesn't
                          ;; actually work, so we do our own buffering here. this
                          ;; is all flushed out in the tcp-connect-cb.
                          (let ((bytes (if (stringp data)
                                           (babel:string-to-octets data :encoding :utf-8)
                                           data)))
  