anchor.diff:    ((connection :initarg :connection :reader tcp-stream-connection)
      (current-packet :initform nil :accessor tcp-stream-packet)))
   
  +(defclass tcp-stream (gray:fundamental-character-input-stream
  +                      gray:fundamental-character-output-stream
  +                      sys.int::external-format-mixin
  +                      tcp-octet-stream
  +                      gray:unread-char-mixin)
  +  ())
  +
   (defmethod mezzano.network:local-endpoint ((object tcp-octet-stream))
     (let ((conn (tcp-stream-connection object)))
       (values (tcp-connection-local-ip conn)
  
positive.code: (defmacro with-tcp-connection-locked (connection &body body)
    `(mezzano.supervisor:with-mutex ((tcp-connection-lock ,connection))
       ,@body))
  
  (defun get-tcp-listener-without-lock (local-ip local-port)
    (dolist (listener *tcp-listeners*)
      (when (and (or (mezzano.network.ip:address-equal
                      (tcp-listener-local-ip listener) local-ip)
                     (mezzano.network.ip:address-equal
                      (tcp-listener-local-ip listener) +ip-wildcard+))
                 (eql (tcp-listener-local-port listener) local-port))
        (return listener))))
  
  (defun get-tcp-listener (local-ip local-port)
    (mezzano.supervisor:with-mutex (*tcp-listener-lock*)
      (get-tcp-listener-without-lock local-ip local-port)))
  
  (defun get-tcp-connection (remote-ip remote-port local-ip local-port)
    (mezzano.supervisor:with-mutex (*tcp-connection-lock*)
  
negative.code: (defmethod stream-element-type ((stream tcp-octet-stream))
    '(unsigned-byte 8))
  
  (defun tcp-stream-connect (address port &key element-type external-format)
    (cond ((or (not element-type)
               (sys.int::type-equal element-type 'character))
  