Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce an :error state for client resource #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions hunchensocket.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
:reader client-request
:initform (error "Must make clients with requests"))
(write-lock :initform (make-lock))
(state :initform :disconnected)
(state :initform :disconnected) ;; states :connected :disconnected :error
(pending-fragments :initform nil)
(pending-opcode :initform nil)))

Expand Down Expand Up @@ -173,10 +173,11 @@ format control and arguments."
(client-connected resource client)
(funcall fn))
(bt:with-lock-held (lock)
(with-slots (write-lock) client
(with-slots (write-lock state) client
(bt:with-lock-held (write-lock)
(setq clients (remove client clients)))
(setq write-lock nil)))
(setq write-lock nil
state :error)))
(client-disconnected resource client))))

(defmacro with-new-client-for-resource ((client-sym &key input-stream
Expand Down