From: jsancho Date: Fri, 6 Nov 2009 19:10:05 +0000 (+0000) Subject: (no commit message) X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=ca6a66c5bbd26fb490b563189bd292a7c7f5f8a0;p=gacela.git --- diff --git a/gacela.lisp b/gacela.lisp index de3a3f8..5d6eae0 100644 --- a/gacela.lisp +++ b/gacela.lisp @@ -204,13 +204,19 @@ (maphash (lambda (key res) (free-resource key)) resources-table))) -;;; Connection with the GUI -(let (socket) - (defun connect-to-gui () - (setq socket (si::socket 1984 :host "localhost"))) +;;; Gacela Server for development mode +(let (socket clients) + (defun server-running? () + (if socket t nil)) - (defun eval-from-gui () - (cond ((and socket (listen socket)) (eval (read socket)))))) + (defun start-server (port) + (setq socket (si::socket port :server #'eval-from-client))) + + (defun check-server-connections () + (when (si::listen socket) (push (si:accept socket) clients))) + + (defun eval-from-clients () + (dolist (cli clients) (when (si::listen cli) (eval (read cli)))))) ;;; GaCeLa Functions