                                   :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)

                        ((string-equal "delete" type)
                         (goto-char cur-point)
                         (delete-char content)))
                     (setq-local emdocs-is-network-insert nil))))))
            (buffer-contents
             (with-current-buffer buffer
               (when emdocs-mode
                 (let ((prev-point (point)))
                   (setq-local emdocs-is-network-insert t)
                   (unwind-protect
                       (progn
                         (goto-char (point-min))
                         (erase-buffer)
                         (insert buffer-contents)
                         (goto-char prev-point))
                     (setq-local emdocs-is-network-insert nil)
                     (setq-local emdocs-undo-list nil))))))))))

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