Changeset 36 for branches/home/psmith
- Timestamp:
- 01/15/07 04:52:17 (18 years ago)
- Location:
- branches/home/psmith/restructure
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified branches/home/psmith/restructure/run-yarpc-client.lisp ¶
r35 r36 7 7 (let ((sm (nio:add-connection "127.0.0.1" 16323 'nio-yarpc:yarpc-state-machine))) 8 8 (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)"))) 10 10 11 11 -
TabularUnified branches/home/psmith/restructure/src/buffer/buffer.lisp ¶
r35 r36 122 122 (defmethod bytebuffer-read-vector((bb byte-buffer) &optional (num-bytes-to-read (remaining bb))) 123 123 (let ((vec (make-uint8-seq num-bytes-to-read))) 124 (with-slots (buf ) bb125 (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))) 126 126 vec)) 127 127 -
TabularUnified branches/home/psmith/restructure/src/io/nio-server.lisp ¶
r35 r36 93 93 (format t "Poll-error, exiting..~%") 94 94 (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))) 97 98 (loop for (fd . event) in unix-epoll-events do 98 99 (cond 99 100 100 ;; new connection 101 101 ((= fd sock) … … 136 136 137 137 (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))))))))) 139 139 (format t "Process client adds~%") 140 140 -
TabularUnified branches/home/psmith/restructure/src/protocol/yarpc/yarpc-packet-factory.lisp ¶
r35 r36 44 44 (if (>= (remaining buf) 1) ;; First byte denotes packet ID 45 45 (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))))) 47 47 (1 (format t "got METHOD-RESPONSE-PACKET-ID~%"))))) 48 48 -
TabularUnified branches/home/psmith/restructure/src/protocol/yarpc/yarpc-state-machine.lisp ¶
r35 r36 101 101 102 102 ;Process a call method packet, returns 103 (defmethod process-incom ming-packet ((sm yarpc-state-machine) (call call-method-packet))103 (defmethod process-incoming-packet ((sm yarpc-state-machine) (call call-method-packet)) 104 104 ;todo change state, create method-response packet and return it 105 105 ;(assert (eql state 0)) 106 (format t "yarpc-state-machine:process-incoming-packet called :sm ~A :packet ~A~%" sm call) 106 107 (handler-case 107 108 (let ((result (execute-call (get-call-string call)))) -
TabularUnified branches/home/psmith/restructure/src/statemachine/state-machine.lisp ¶
r35 r36 32 32 ;Base class for state machines 33 33 ; 34 ;Converts incom ming data between bytes and packets using the supplied packet-factory.34 ;Converts incoming data between bytes and packets using the supplied packet-factory. 35 35 ;Converts outgoing data between packets and bytes using the write-bytes method on packet. 36 36 ; … … 43 43 (format stream "#<STATE-MACHINE ~A >" (call-next-method sm nil))) 44 44 45 (defgeneric process-incom ming-packet(state-machine packet))45 (defgeneric process-incoming-packet(state-machine packet)) 46 46 47 47 … … 55 55 (defmethod process-read((sm state-machine)) 56 56 (with-slots (foreign-read-buffer) sm 57 (let ((incom ming-packet (get-packet (get-packet-factory sm) foreign-read-buffer)))58 (format t "state-machine::process-read - incom ming packet: ~A~%" incomming-packet)59 (when incom ming-packet60 (when (not (process-incom ming-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)) 61 61 (close-sm sm)))))) 62 62
Note: See TracChangeset
for help on using the changeset viewer.