     (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*)))))
+               (rassq-delete-all sock *emdocs-server-clients*)))))
 
 (defun emdocs-server-filter (sock msg)
   "docstring"

                      (not (eq client 'no-conn)))
             (delete-process client)))
  (setq emdocs-client-list nil)
  (remove-hook 'after-change-functions #'emdocs-after-change-function))

;;; interactives

  (let* ((json-object-type 'plist)
         (json-msg (json-read-from-string msg)))
    (unless (member (plist-get json-msg :ip) *emdocs-client-connections*)
      (add-to-list '*emdocs-server-clients* (cons (plist-get json-msg) sock))
      (emdocs-connect-client (plist-get json-msg :buffer)
                             (plist-get json-msg :ip))
      (emdocs-broadcast-message msg))))
