Ignore:
Timestamp:
02/10/07 23:52:32 (18 years ago)
Author:
psmith
Message:

getting there...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified branches/home/psmith/restructure/src/protocol/yarpc/yarpc-packet-factory.lisp

    r81 r82  
    4141(defconstant +PACKET-ID-SIZE+ 1)
    4242(defconstant +PACKET-LENGTH-SIZE+ 4)
    43 ;(defconstant +PACKET-REQUEST-ID+ 4)
     43(defconstant +PACKET-REQUEST-ID-SIZE+ 4)
    4444
    4545(defconstant +yarpc-packet-header-size+
     
    5454            (let* ((packet-request-id (bytebuffer-read-32 buf))
    5555                   (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))))))
    5858              (compact buf)
    5959              #+nio-debug  (format-log t "yarpc-packet-factory:get-packet - after compact ~%~A~%" buf)
     
    7171               :reader request-id)))
    7272
    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))
    7779
    7880(defmethod print-object ((packet call-method-packet) stream)
     
    104106             :accessor response)))
    105107
    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))
    108110
    109111(defmethod print-object ((packet method-response-packet) stream)
Note: See TracChangeset for help on using the changeset viewer.