anchor.diff:    (tcp-send (tcp-stream-connection stream) sequence start end))
   
   (defmethod close ((stream tcp-octet-stream) &key abort)
  +  ;; TODO: ABORT should abort the connection entirely.
  +  ;; Don't even bother sending RST packets, just detatch the connection.
     (declare (ignore abort))
  -  (with-tcp-connection-locked (tcp-stream-connection stream)
  -    (close-tcp-connection (tcp-stream-connection stream))))
  +  (let ((connection (tcp-stream-connection stream)))
  +    (with-tcp-connection-locked connection
  +      ;; FIXME: What about the other states?
  +      ;; Connections in :LAST-ACK, :FIN-WAIT-1, and :FIN-WAIT-2 are
  +      ;; visible outside the network stack.
  +      (ecase (tcp-connection-state connection)
  +        (:established
  +         (setf (tcp-connection-state connection) :fin-wait-1)
  +         (tcp4-send-packet connection
  +                           (tcp-connection-s-next connection)
  +                           (tcp-connection-r-next connection)
  +                           nil
  +                           :fin-p t))
  +        (:close-wait
  +         (setf (tcp-connection-state connection) :last-ack)
  +         (tcp4-send-packet connection
  +                           (tcp-connection-s-next connection)
  +                           (tcp-connection-r-next connection)
  +                           nil
  +                           :fin-p t))
  +        (:closed)))))
   
   (defmethod open-stream-p ((stream tcp-octet-stream))
     (with-tcp-connection-locked (tcp-stream-connection stream)
  
positive.code:          (if (zerop data-length)
               (when (and (= seq (tcp-connection-r-next connection))
                          (logtest flags +tcp4-flag-fin+))
                 ;; Remote have sended FIN and waiting for ACK
                 (setf (tcp-connection-r-next connection)
                       (logand (+ (tcp-connection-r-next connection) 1)
                               #xFFFFFFFF))
  
negative.code:          (cond ((and (eql flags +tcp4-flag-ack+)
                       (eql seq (tcp-connection-r-next connection))
                       (eql ack (tcp-connection-s-next connection)))
                  ;; Remote has sent ACK, connection established
                  (setf (tcp-connection-state connection) :established)
                  (when listener
                    (remhash connection (tcp-listener-pending-connections listener))
  