anchor.diff:  (defun net-init (mode host port)
     (assert (not (boundp '*mode*)))
     (ecase mode
  -    ((:server :client)
  +    ((:server)
  +     (let ((socket (usocket:socket-listen usocket:*wildcard-host* port
  +                                          :element-type '(unsigned-byte 8))))
  +       (setf *server-socket* socket
  +             *local-port* (usocket:get-local-port socket))))
  +    ((:client)
        (when (eql mode :client)
  -       (setf *remote-host* host *remote-port* port port usocket:*auto-port*))
  -     (let* ((socket (usocket:socket-connect
  -                     nil nil :protocol :datagram :local-port port))
  -            (host (usocket:get-local-address socket))
  -            (port (usocket:get-local-port socket)))
  -       (setf *local-host* host *local-port* port *socket* socket)))
  +       (setf *remote-host* host *remote-port* port)))
       ((:normal)))
     (setf *mode* mode))
   
   (defun net-connect (&optional (abort-handler #'default-abort-handler))
     (ecase *mode*
       ((:server)
  -     (multiple-value-bind (request host port) (net-receive)
  +     (usocket:wait-for-input *server-socket* :timeout nil :ready-only t)
  +     (setf *socket* (usocket:socket-accept *server-socket*))
  +     (let ((request (net-receive)))
          (unless (equal (assoc :request request) '(:request :init))
            (funcall abort-handler))
  -       (setf *remote-host* host *remote-port* (second (assoc :port request)))
          (net-send '((:response :init)))))
       ((:client)
  -     (net-send `((:request :init) (:port ,*local-port*)))
  +     (setf *socket* (usocket:socket-connect *remote-host* *remote-port*
  +                                            :element-type '(unsigned-byte 8)))
  +     (net-send `((:request :init)))
        (unless (equal (net-receive :timeout 10) '((:response :init)))
          (funcall abort-handler)))
       ((:normal))))
  
positive.code: (defconstant +max-buffer-size+ 65536)
  
  (defvar *mode*)
  (defvar *local-host*)
  (defvar *local-port*)
  (defvar *remote-host*)
  (defvar *remote-port*)
  (defvar *socket*)
  (defvar *buffer*
    (make-array +max-buffer-size+ :element-type '(unsigned-byte 8)))
  
negative.code:   (assert (boundp '*mode*))
    (ecase *mode*
      ((:server :client)
       (usocket:socket-close *socket*)
       (when (eql *mode* :server)
         (usocket:socket-close *server-socket*)))
      ((:normal)))
    (makunbound '*socket*)
    (makunbound '*mode*))
  
  (defun net-receive (&key timeout)
    (assert (or (eql *mode* :server) (eql *mode* :client)))
    (cl-store:restore (usocket:socket-stream *socket*)))
  
  (defun net-send (message)
    (assert (or (eql *mode* :server) (eql *mode* :client)))
    (cl-store:store message (usocket:socket-stream *socket*))
    (force-output (usocket:socket-stream *socket*)))
  
  (defmacro with-serve-request ((request &key timeout) &body body)
    `(let ((,request (net-receive :timeout ,timeout)))
  