                                   :attached-buffer buffer
                                   :ip ip)))
         (add-to-list '*emdocs-incoming-clients* client)
-        (emdocs-send-file-periodically client sock msg))
+        (emdocs-send-file client sock msg))
       (unless (find ip *emdocs-outgoing-clients*
                     :test #'emdocs-is-ip-from-client)
         (emdocs-connect-client buffer ip))

                  (equal (emdocs-get-process client) sock))
                *emdocs-incoming-clients*)))))

(defun emdocs-send-file-periodically (client sock msg)
  (when (and (get-buffer (emdocs-get-attached-buffer client))
             (process-live-p (emdocs-get-process client)))
    (with-current-buffer (emdocs-get-attached-buffer client)

             :buffer_contents ,(with-current-buffer
                                           (emdocs-get-attached-buffer client)
                                         (buffer-string))))
          "\n"))))))

;;; TODO: make resyncing the file a command

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