[slime-devel] Re: Slime cannot connect to ACL6.2 win32

Luke Gorrie luke at bluetail.com
Thu Jul 22 06:26:00 UTC 2004


Thomas Schilling <tjs_ng at yahoo.de> writes:

> The exact error message is:
>
>    (stream/warning) failure to open network stream to host "localhost"
> for service "4005"
>
> Took a look at the changelog--Luke, something to confess?
>
> The relevant init.el part:
>
> ;; start up slime
> (global-set-key [(f5)]
>    '(lambda ()
>      (interactive)
>      (shell-command "c:/programme/acl62-demo/allegro-ansi.exe  +B +cm
> -L
> ~/slime.lisp&")
>      (sleep-for 3)
>      (slime-connect "localhost" 4005)
>      (cd "~/Eigene Dateien/")))

Is it just the obvious race condition? That function assumes that Lisp
will have the server up and running within 3 seconds. If it's not up
in time then you'd get the error you respoted. Note that if the Lisp
sources have changed (e.g. after cvs update) then swank-loader will
recompile them, and that could easily take more than 3 seconds.

The smallest fix would be to change the connecting part to something
like:

  (while (not (ignore-errors (slime-connect "localhost" 4005) t))
    (sit-for 1))

.. to loop until the connection succeeds.






More information about the slime-devel mailing list