Skip to content

Instantly share code, notes, and snippets.

@zkat
Last active August 29, 2015 14:24
Show Gist options
  • Save zkat/4611 to your computer and use it in GitHub Desktop.
Save zkat/4611 to your computer and use it in GitHub Desktop.
(defun get-input-from-client (client)
(let* ((stream (usocket:socket-stream (socket client)))
(collected-bytes (loop with b
do (setf b (read-byte stream))
until (= b (char-code #\Newline))
unless (not (standard-char-p (code-char b)))
collect (code-char b))))
(coerce collected-bytes 'string)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment