/[slime]/slime/swank.lisp
ViewVC logotype

Diff of /slime/swank.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.105 by heller, Tue Jan 20 23:41:31 2004 UTC revision 1.106 by heller, Wed Jan 21 22:33:45 2004 UTC
# Line 189  If *REDIRECT-IO* is true, all standard I Line 189  If *REDIRECT-IO* is true, all standard I
189    
190  (defun setup-server (port announce-fn background)  (defun setup-server (port announce-fn background)
191    (setq *write-lock* (make-lock :name "Swank write lock"))    (setq *write-lock* (make-lock :name "Swank write lock"))
192    (if (eq *swank-in-background* :spawn)    (let* ((socket (create-socket port))
193        (spawn (lambda () (open-swank-socket port announce-fn nil))           (port (local-port socket)))
194               :name "Swank")      (funcall announce-fn port)
195        (open-swank-socket port announce-fn background)))      (if (eq *swank-in-background* :spawn)
196            (spawn (lambda () (serve-connection socket nil)) :name "Swank")
197            (serve-connection socket background))
198        port))
199    
200  (defun open-swank-socket (port announce-fn background)  (defun serve-connection (socket background)
201    (let ((socket (create-socket port)))    (let ((client (accept-connection socket)))
202      (funcall announce-fn (local-port socket))      (close-socket socket)
203      (let ((client (accept-connection socket)))      (let ((connection (create-connection client)))
204        (close-socket socket)        (init-main-connection connection)
205        (let ((connection (create-connection client)))        (serve-requests client connection background))))
         (init-main-connection connection)  
         (serve-requests client connection background)))))  
206    
207  (defun serve-requests (client connection background)  (defun serve-requests (client connection background)
208    (ecase background    (ecase background
209      (:fd-handler (add-input-handler      (:fd-handler (add-input-handler
210                    client (lambda ()                    client (lambda ()
211                             (loop (cond ((handle-request connection)                             (loop (cond ((handle-request connection)
212                                          (remove-input-handlers client)                                          (remove-input-handlers client)
213                                          (return))                                          (return))

Legend:
Removed from v.1.105  
changed lines
  Added in v.1.106

  ViewVC Help
Powered by ViewVC 1.1.5