From: <do...@co...> - 2000-03-22 19:20:43
|
This is the top level function from the webserver I posted: (defun start-server (&key (port 8000)) ;; start the web server running on the given port. ;; Note that on unix, ports below 1024 can only be obtained by ;; programs running as root. ;; The default port number for web browsers is 80, to use any other ;; port number in a url you have to put that port number after the ;; machine name as in http://www.foo.com:8000/the/url/I/want ;; (let ((websocket ;; *** generalize from ACL #+clisp (lisp:socket-server port) #+allegro (socket:make-socket :connect :passive :local-port port))) (unwind-protect (loop ;; It turns out that all the stream operations can and in ;; practice do generate errors. ;; The practical solution is to put an ignore-errors ;; at a pretty high level. (multiple-value-bind (ignore err) ;; *** (ignore-errors (let ((connection ;; *** generalize from ACL #+clisp (lisp:socket-accept websocket) #+allegro (socket:accept-connection websocket))) (unwind-protect (do-command connection #'(lambda () (return-from start-server))) (close connection)))) (declare (ignore ignore)) (when err (log- "~%error : ~A" err)))) ;; *** generalize from ACL #+clisp (lisp:socket-server-close websocket) #+allegro (close websocket)))) Note the do-command inside the ignore-errors. When I run this compiled I get breaks, and when I type "where" I see that I'm in do-command. If I interpret this code things work. Do you have any immediate suspects or do you want further data? If so, what should I send you? |