                    [server-addr port listen-result-ch])
              (when-let [[accept-ch close-accept-ch] (atake server-init listen-result-ch)]
                (cbfg.world.net/server-accept-loop world accept-ch close-accept-ch)
-               (prog-event #(update-in % [:prog-peers :servers server-addr]
+               (prog-event :kv-server
+                           #(update-in % [:prog-peers :servers server-addr]
                                        conj port)))))
          (reset! done true))
     (wait-done done)))

         (let [req-ch (cbfg.world.net/client-loop world (:net-connect-ch @prog-base)
                                                  server-addr server-port
                                                  client-addr (:res-ch @prog-base))]
           (prog-event #(assoc-in % [:prog-peers :clients client-addr]
                                  {:client-addr client-addr
                                   :server-addr server-addr
                                   :server-port server-port

                          ;   :res-ch => ch }

(def prog-history
  (atom {:prog-peers {:servers {}  ; { server-addr => ports }.
                      :clients {}} ; { client-addr => client-info }.
         :prog-events []})) ; Each event is [ts label args].

(def run-world       (atom nil))
(def run-world-hover (atom nil))

; -------------------------------------------------------------------

(defn render-world [app owner]
  (apply dom/ul nil
         (map (fn [[k v]] (dom/li nil (str k ":" v)))
              (:prog-peers app))))

(defn on-event-focus [ts label args]
  (reset! run-world-hover args)
  (.add gdom/classes (gdom/getElement "world-container") "hover"))

(defn on-event-blur []
  (reset! run-world-hover nil)
  (.remove gdom/classes (gdom/getElement "world-container") "hover"))

(defn render-events [app owner]
  (apply dom/ul nil
         (map (fn [[ts label args]]
                (dom/li #js {:onMouseEnter #(on-event-focus ts label args)
                             :onMouseLeave #(on-event-blur)}
                        (str ts label args)))
              (:prog-events app))))

(defn render-clients [app owner]
  (apply dom/select #js {:id "client"}
