anchor.diff:    (%make-rpc-server :programs programs
   		    :auth-handler auth-handler))
   
  +
  +(defstruct rpc-connection 
  +  conn time)
  +
   (defun run-rpc-server (server tcp-ports udp-ports &key (timeout 60))
     "Run the RPC server until the SERVER-EXITING flag is set. Will open TCP sockets listening
   on the TCP-PORTS list and UDP sockets listening on the UDP-PORTS list."
  -  (let (tcp-sockets udp-sockets)
  +  (let (tcp-sockets udp-sockets connections)
       (unwind-protect 
   	 (progn 
   	   ;; collect the sockets this way so that if there is an error thrown (such as can't listen on port)
  
positive.code: 
  	   (do ((udp-buffer (nibbles:make-octet-vector 65507)))
  	       ((rpc-server-exiting server))
  	     ;; poll and timeout each second so that we can check the exiting flag
  	     (let ((ready (usocket:wait-for-input (append tcp-sockets udp-sockets) :ready-only t :timeout 1)))
  	       (dolist (socket ready)
  		 (etypecase socket
  		   (usocket:stream-server-usocket
  		    ;; a tcp socket to accept
  		    (accept-rpc-connection server socket timeout))
  		   (usocket:datagram-usocket
  		    ;; a udp socket is ready to read from
  		    (handler-case (accept-udp-rpc-request server socket udp-buffer)
  		      (error (e)
  			;; windows is known to throw an error on receive if there was no-one 
  			;; listening on the port the previous UDP packet was sent to.
  			(log:debug "~A" e)))))))))
        ;; close the server sockets
        (dolist (tcp tcp-sockets)
  	(usocket:socket-close tcp))
  
negative.code: 
  ;; ------------- rpc server ----------
  
  (defun process-rpc-connection (server conn)
    (let ((stream (usocket:socket-stream conn)))
      (log:debug "Reading request")
      (flexi-streams:with-input-from-sequence (input (read-fragmented-message stream))
        (log:debug "Read request")
        (let ((buff (flexi-streams:with-output-to-sequence (output)
  		    (with-caller-binded ((usocket:get-peer-address conn)
  					 (usocket:get-peer-port conn)
  					 :tcp)
  		      (handle-request server input output)))))
  	(log:debug "Writing response")
  	;; write the fragment header (with terminating bit set)
  	(write-uint32 stream (logior #x80000000 (length buff)))
  	;; write the buffer itself
  	(write-sequence buff stream)
  	;; flush output
  	(force-output stream)))))
  
  (defun accept-rpc-connection (server socket timeout)
    "Accept a TCP connection and process the request(s). Will keep processing requests from the connection
  