Changeset 76 for branches/home
- Timestamp:
- 02/07/07 01:48:24 (18 years ago)
- Location:
- branches/home/psmith/restructure
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified branches/home/psmith/restructure/run-http.lisp ¶
r27 r76 2 2 (require :asdf) 3 3 (require :nio-http) 4 (nio:start-server ' identity 'identity 'nio-http:http-state-machine :host "127.0.0.1")4 (nio:start-server 'nio-http:http-state-machine :host "127.0.0.1") -
TabularUnified branches/home/psmith/restructure/src/event/epoll.lisp ¶
r43 r76 74 74 75 75 (defun poll-events (event-queue) 76 #+nio-debug (format t "poll-events called with :event-queue ~A~%" event-queue)76 #+nio-debug2 (format t "poll-events called with :event-queue ~A~%" event-queue) 77 77 (with-foreign-object (events 'epoll-event +epoll-size+) 78 78 (memzero events (* +epoll-event-size+ +epoll-size+)) … … 81 81 do 82 82 (progn 83 #+nio-debug (format t "poll-events - dealing with ~A~%" res)83 #+nio-debug2 (format t "poll-events - dealing with ~A~%" res) 84 84 (case res 85 85 (-1 -
TabularUnified branches/home/psmith/restructure/src/io/nio-server.lisp ¶
r74 r76 35 35 36 36 ;TODO thread safety 37 (defparameter +connected-sockets + nil37 (defparameter +connected-sockets-queue+ (nio-compat:concurrent-queue) 38 38 "List of sockets that have been connected and are awaiting addition to the event-notification system") 39 39 … … 60 60 client-hash) 61 61 (dolist (async-fd removals) 62 (remhash (async-fd-read-fd async-fd) client-hash)) 63 (format t "client-hash list ~A~%"client-hash )))62 (remhash (async-fd-read-fd async-fd) client-hash)))) 63 ; (format t "client-hash list ~A~%"client-hash ) 64 64 65 65 66 66 67 67 68 (defun start-server (connection- handler accept-filter connection-type68 (defun start-server (connection-type 69 69 &key 70 70 (protocol :inet) … … 154 154 155 155 ;add outgoing sockets to event queue 156 (format-log t "nio-server:start-server - Processing client add ~A~%" +connected-sockets+) 157 (loop for new-fd in +connected-sockets+ do 156 #+nio-debug2 (format-log t "nio-server:start-server - Processing client add ~A~%" +connected-sockets-queue+) 157 158 (loop for new-fd = (nio-compat:take +connected-sockets-queue+ :blocking-call nil) until (null new-fd) do 158 159 (format-log t "nio-server:start-server - Dealing with ~A~%" new-fd) 159 160 (setf (gethash (async-fd-read-fd new-fd) client-hash) new-fd) 160 161 (add-async-fd event-queue new-fd :read-write)) 161 162 ;TODO thread safety163 (setf +connected-sockets+ nil)164 162 165 163 ;loop over async-fd's processing where necessary … … 182 180 (if (connect-inet-socket sock host port) 183 181 (let ((sm (create-state-machine connection-type sock sock sock))) 184 (push sm +connected-sockets+) 185 (format-log t "nio-server:add-connection - Socket enqueued: ~A~%" +connected-sockets +)182 (nio-compat:add +connected-sockets-queue+ sm) 183 (format-log t "nio-server:add-connection - Socket enqueued: ~A~%" +connected-sockets-queue+) 186 184 (return-from add-connection sm)) 187 185 (format t "Connect failed!!~A ~%" (get-errno))))) -
TabularUnified branches/home/psmith/restructure/src/nio-logger/nio-logger.lisp ¶
r74 r76 46 46 (defun tail-log(filename ip-address) 47 47 ;;shouldn't be listenting on the client hence nil for accept SM to start-server 48 (sb-thread:make-thread #'(lambda()(nio:start-server 'identity 'identity nil :host "127.0.0.1" :port 9897)) :name "nio-server") 49 (sleep 4) 48 (sb-thread:make-thread #'(lambda()(nio:start-server nil)) :name "nio-server") 50 49 (let ((sm (nio:add-connection ip-address 16323 'nio-yarpc:yarpc-client-state-machine))) 51 50 (nio-utils:format-log t "toplevel adding conn ~A to ~A~%" sm ip-address) … … 63 62 (setf +log-file-name+ out-file) 64 63 (nio:load-ips allowed-ips) 65 (sb-thread:make-thread #'(lambda()(nio:start-server ' identity 'identity 'nio-yarpc:yarpc-state-machine :host listen-ip :accept-connection 'nio:check-ip)) :name "nio-server")64 (sb-thread:make-thread #'(lambda()(nio:start-server 'nio-yarpc:yarpc-state-machine :host listen-ip :accept-connection 'nio:check-ip)) :name "nio-server") 66 65 (loop 67 66 ;;block waiting for jobs
Note: See TracChangeset
for help on using the changeset viewer.