Skip to content

Commit

Permalink
Added comment and removed debug prints.
Browse files Browse the repository at this point in the history
  • Loading branch information
larstvei committed Sep 29, 2013
1 parent ac1dd9e commit 6dbd952
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions shared-buffer-server.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

(defun string-chunks (max-len str)
"Returns a list of strings, where max-len is the maximum length of each
string."
string. It also returns the length of the list (the number of chunks)."
(let* ((len (length str))
(chunks (floor (/ len max-len))))
(values
Expand All @@ -52,23 +52,13 @@ string."
buffer."
(setf message (format nil "~d ~a " (length message) message))
(loop for client in client-group do
;; -- DEBUG -- ;;
(print message)
(force-output)
;; ----------- ;;
(multiple-value-bind (strings chunks)
(string-chunks (expt 2 10) message)
(mapc (lambda (str)
(write-string str (client-stream client))
(finish-output (client-stream client))
(unless (zerop (decf chunks))
(sleep 0.005))

;; -- DEBUG -- ;;
(format t "chunk size: ~d~%chunks left: ~d~%" (length str) chunks)
(force-output)
;; ----------- ;;
) strings))))
(sleep 0.005))) strings))))

(defun remove-from-group (client)
"Fetches the client-group the given client is a part of, and returns it's
Expand Down

0 comments on commit 6dbd952

Please sign in to comment.