 
 (defun emdocs-client-sentinel (client sock msg)
   "docstring"
-  (with-current-buffer (emdocs-get-attached-buffer client)
+  (with-current-buffer (emdocs-get-client-process-buffer
+                        (emdocs-get-attached-buffer client))
     (goto-char (point-min))
     (insert "sentinel:" msg)
     (unless (bolp) (newline)))

   (ip
    :initarg :ip
    :accessor emdocs-get-ip
    :documentation "docstring"))
  "docstring")

(defmethod emdocs-set-process ((client emdocs-client) process)
  (setf (emdocs-get-process client) process))

;;; functions


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

(defun emdocs-extract-line (str)
  "docstring"
  ;; returns cons containing:
  ;; car: the first line
  ;; cdr: the string without the first line
  (let ((res (string-match ".*\n" str)))
    (if res
        (let* ((matched-str (match-string-no-properties 0 str))
               (match-length (length matched-str))
               (removed-str (substring str match-length)))
          (cons matched-str removed-str))
      nil)))

(defun emdocs-client-filter-parse (client sock msg)
  "docstring"
  (if (string-match "^give me buffer and ip\n$" msg)
      (process-send-string
       sock
