     (unless (bolp) (newline)))
   (let* ((json-object-type 'plist)
          (json-msg (json-read-from-string msg)))
-    (emdocs-connect-client (plist-get json-msg :buffer)
-                           (plist-get json-msg :ip))))
+    (unless (member (plist-get json-msg :ip) *emdocs-client-connections*)
+      (emdocs-connect-client (plist-get json-msg :buffer)
+                             (plist-get json-msg :ip))
+      (emdocs-broadcast-message msg))))
 
 (defun emdocs-setup-server (my-ip)
   "docstring"

(defvar *emdocs-server* nil
  "docstring")

(defvar *emdocs-clients* nil
  "docstring")

;;; functions

    (insert "sentinel:" msg)
    (unless (bolp) (newline)))
  (cond ((string-match "^open from [0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+\n$" msg)
         (add-to-list '*emdocs-server-clients* sock)
         (process-send-string sock "give me buffer and ip\n"))
        ((string-match "^connection broken by remote peer\n$" msg)
         (setq *emdocs-server-clients*
               (delete sock *emdocs-server-clients*)))))

(defun emdocs-server-filter (sock msg)
  "docstring"
