"Steven E. Harris" seharris@raytheon.com writes:
If the style is not :spawn, serve-connection will only be called once. Keeping the server socket open after that one connection gets serviced won't help any subsequent operations.
Are you sure? The current CVS version looks like this:
(defun setup-server (port announce-fn style dont-close) (declare (type function announce-fn)) (let* ((socket (create-socket *loopback-interface* port)) (port (local-port socket))) (funcall announce-fn port) (ecase style (:spawn (spawn (lambda () (loop do (serve-connection socket :spawn dont-close) while dont-close)) :name "Swank")) ((:fd-handler :sigio) (add-fd-handler socket (lambda () (serve-connection socket style dont-close)))) ((nil) (unwind-protect (loop do (serve-connection socket style dont-close) while dont-close) (close-socket socket)))) port))
For style=NIL we loop and subsequent connections are served sequentially. I install an fd-handler for both :sigio and :fd-handler, because it didn't seems necessary to do signal driven io on the server socket. I didn't test it extensively, but I fail to see why this version can't handle multiple connections.
Helmut.