- Timestamp:
- 02/10/07 23:52:32 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified branches/home/psmith/restructure/src/protocol/yarpc/yarpc-packet-factory.lisp ¶
r81 r82 41 41 (defconstant +PACKET-ID-SIZE+ 1) 42 42 (defconstant +PACKET-LENGTH-SIZE+ 4) 43 ;(defconstant +PACKET-REQUEST-ID+ 4)43 (defconstant +PACKET-REQUEST-ID-SIZE+ 4) 44 44 45 45 (defconstant +yarpc-packet-header-size+ … … 54 54 (let* ((packet-request-id (bytebuffer-read-32 buf)) 55 55 (ret-packet (ecase packet-id 56 (0 (progn (format-log t "yarpc-packet-factory:get-packet - got CALL-METHOD-PACKET-ID~%") (call-method-packet (bytebuffer-read-string buf (- packet-length +yarpc-packet-header-size+ )) :request-id packet-request-id)))57 (1 (progn (format-log t "yarpc-packet-factory:get-packet - got METHOD-RESPONSE-PACKET-ID~%") (method-response-packet (bytebuffer-read-string buf (- packet-length +yarpc-packet-header-size+ )) :request-id packet-request-id))))))56 (0 (progn (format-log t "yarpc-packet-factory:get-packet - got CALL-METHOD-PACKET-ID~%") (call-method-packet (bytebuffer-read-string buf (- packet-length +yarpc-packet-header-size+ +PACKET-REQUEST-ID-SIZE+)) :request-id packet-request-id))) 57 (1 (progn (format-log t "yarpc-packet-factory:get-packet - got METHOD-RESPONSE-PACKET-ID~%") (method-response-packet (bytebuffer-read-string buf (- packet-length +yarpc-packet-header-size+ +PACKET-REQUEST-ID-SIZE+)) :request-id packet-request-id)))))) 58 58 (compact buf) 59 59 #+nio-debug (format-log t "yarpc-packet-factory:get-packet - after compact ~%~A~%" buf) … … 71 71 :reader request-id))) 72 72 73 (defclass call-method-packet (yarpc-packet)((call-string :initarg :call-string 74 :accessor call-string))) 75 (defun call-method-packet (call-string) 76 (make-instance 'call-method-packet :call-string call-string)) 73 (defclass call-method-packet (yarpc-packet) 74 ((call-string :initarg :call-string 75 :accessor call-string))) 76 77 (defun call-method-packet (call-string &key request-id) 78 (make-instance 'call-method-packet :call-string call-string :request-id request-id)) 77 79 78 80 (defmethod print-object ((packet call-method-packet) stream) … … 104 106 :accessor response))) 105 107 106 (defun method-response-packet (response )107 (make-instance 'method-response-packet :response response ))108 (defun method-response-packet (response &key request-id) 109 (make-instance 'method-response-packet :response response :request-id request-id)) 108 110 109 111 (defmethod print-object ((packet method-response-packet) stream)
Note: See TracChangeset
for help on using the changeset viewer.