Changeset 36 for branches/home/psmith


Ignore:
Timestamp:
01/15/07 04:52:17 (18 years ago)
Author:
psmith
Message:

yarpc ready to create response packet

Location:
branches/home/psmith/restructure
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified branches/home/psmith/restructure/run-yarpc-client.lisp

    r35 r36  
    77(let ((sm (nio:add-connection "127.0.0.1" 16323 'nio-yarpc:yarpc-state-machine)))
    88(format t "toplevel adding conn ~A~%" sm)
    9 (format t "Result of remote-execute ~A~%" (nio-yarpc:remote-execute sm "(test-rpc-list)")))
     9(format t "Result of remote-execute ~A~%" (nio-yarpc:remote-execute sm "(nio-yarpc:test-rpc-list)")))
    1010
    1111
  • TabularUnified branches/home/psmith/restructure/src/buffer/buffer.lisp

    r35 r36  
    122122(defmethod bytebuffer-read-vector((bb byte-buffer) &optional (num-bytes-to-read (remaining bb)))
    123123  (let ((vec  (make-uint8-seq num-bytes-to-read)))
    124     (with-slots (buf) bb
    125       (inc-position bb (cffi:mem-read-vector vec (buffer-buf bb) :unsigned-char num-bytes-to-read)))
     124    (with-slots (buf position) bb
     125      (inc-position bb (cffi:mem-read-vector vec buf :unsigned-char num-bytes-to-read position)))
    126126    vec))
    127127
  • TabularUnified branches/home/psmith/restructure/src/io/nio-server.lisp

    r35 r36  
    9393                                     (format t "Poll-error, exiting..~%")
    9494                                     (throw 'poll-error-exit nil))))
    95        
    96        (loop for unix-epoll-events = (poll-events event-queue) do
     95       
     96        (loop
     97           (let ((unix-epoll-events (poll-events event-queue)))
    9798             (loop for (fd . event) in unix-epoll-events do         
    9899                  (cond
    99                  
    100100                    ;; new connection
    101101                    ((= fd sock)
     
    136136
    137137                             (when (read-event-p event) (setf (read-ready async-fd) t))
    138                              (when (write-event-p event) (setf (write-ready async-fd) t))))))))
     138                             (when (write-event-p event) (setf (write-ready async-fd) t)))))))))
    139139             (format t "Process client adds~%")
    140140
  • TabularUnified branches/home/psmith/restructure/src/protocol/yarpc/yarpc-packet-factory.lisp

    r35 r36  
    4444  (if (>= (remaining buf) 1) ;; First byte denotes packet ID
    4545    (ecase (elt (bytebuffer-read-vector buf 1) 0)
    46       (0 (progn (format t "got CALL-METHOD-PACKET-ID~%") (make-instance 'call-method-packet (bytebuffer-read-string buf (remaining buf)))))
     46      (0 (progn (format t "got CALL-METHOD-PACKET-ID~%") (make-instance 'call-method-packet :call (bytebuffer-read-string buf (remaining buf)))))
    4747      (1 (format t "got METHOD-RESPONSE-PACKET-ID~%")))))
    4848
  • TabularUnified branches/home/psmith/restructure/src/protocol/yarpc/yarpc-state-machine.lisp

    r35 r36  
    101101
    102102;Process a call method packet, returns
    103 (defmethod process-incomming-packet ((sm yarpc-state-machine) (call call-method-packet))
     103(defmethod process-incoming-packet ((sm yarpc-state-machine) (call call-method-packet))
    104104  ;todo change state, create method-response packet and return it
    105105  ;(assert (eql state 0))
     106  (format t "yarpc-state-machine:process-incoming-packet called :sm ~A :packet ~A~%" sm call)
    106107  (handler-case
    107108    (let ((result (execute-call (get-call-string call))))
  • TabularUnified branches/home/psmith/restructure/src/statemachine/state-machine.lisp

    r35 r36  
    3232;Base class for state machines
    3333;
    34 ;Converts incomming data between bytes and packets using the supplied packet-factory.
     34;Converts incoming data between bytes and packets using the supplied packet-factory.
    3535;Converts outgoing data between packets and bytes using the write-bytes method on packet.
    3636;
     
    4343  (format stream "#<STATE-MACHINE ~A >" (call-next-method sm nil)))
    4444
    45 (defgeneric process-incomming-packet(state-machine packet))
     45(defgeneric process-incoming-packet(state-machine packet))
    4646
    4747
     
    5555(defmethod process-read((sm state-machine))
    5656  (with-slots (foreign-read-buffer) sm
    57     (let ((incomming-packet (get-packet (get-packet-factory sm) foreign-read-buffer)))
    58       (format t "state-machine::process-read - incomming packet: ~A~%" incomming-packet)
    59       (when incomming-packet
    60           (when (not (process-incomming-packet sm incomming-packet))
     57    (let ((incoming-packet (get-packet (get-packet-factory sm) foreign-read-buffer)))
     58      (format t "state-machine::process-read - incoming packet: ~A~%" incoming-packet)
     59      (when incoming-packet
     60          (when (not (process-incoming-packet sm incoming-packet))
    6161            (close-sm sm))))))
    6262
Note: See TracChangeset for help on using the changeset viewer.