[slime-devel] Re: Port File and Dedicated SLIME Instance

Volkan YAZICI yazicivo at ttmail.com
Fri Aug 15 14:25:11 UTC 2008


Hi,

First, thanks so much for your prompt reply.

On Fri, 15 Aug 2008, "Tobias C. Rittweiler" <tcr at freebits.de> writes:
> The temporary file is probably deleted after the connection succeeded.
> You can look into the *inferior-lisp* buffer (cf. above) where the port
> number is shown.

Hrm... I thought it lives in place during the lifetime of the inferior
lisp process.

> You cannot multiply connect to the same swank server. You can however,
> start several swank servers in your Lisp image if the Lisp
> implementation you use supports threads, or serve-event.

Got it.


> You have to manually start the SWANK server, and use CREATE-SERVER's
> :PORT key argument.

For this purpose, I've created two small custom `inferior-lisp' and
`slime-connect' functions.

  (defun custom-slime-connect (host port n-tries)
    (assert (not (< n-tries 0)))
    (unless (zerop n-tries)
      (condition-case data
  	(run-with-timer 0.3 nil #'slime-connect host port)
        (error
         (message "Retrying swank connection... %d" n-tries)
         (custom-slime-connect host port (1- n-tries))))))
  
  (defun custom-slime ()
    (interactive)
    (inferior-lisp (format "%s --load /home/vy/.swank" inferior-lisp-program))
    (custom-slime-connect "127.0.0.1" 4005 10))

But this time evaluation enters into `custom-slime-connect', executes
`(run-with-timer ...)' expression, *Messages* display `Connecting to
Swank on port 4005...' lines (2 times) and nothing happens. Would you
mind helping me to spot the problem?

Furthermore, in the *inferior-lisp* buffer started by `inferior-lisp'
command, after every expression I evaluate in *inferior-lisp* buffer, it
displays

  ;; SWANK: sb-thread::get-foreground ...

in the *inferior-lisp* buffer and the steps into the prompt. Is that
something expected?

BTW, I'm quite suprised that almost everybody is satisfied with the
current close-socket-on-client-disconnects behavior. My client
disconnects from the inferior lisp image nearly two or three times a
day. (I suspect this is because of non-latin characters, despite my
coding-system set to "utf-8-unix".) And because of I cannot reconnect, I
need to start SLIME from scratch, which is quite irritating. IMHO, it'd
awesome if it'd be possible to start a dedicated swank server easily in
SLIME.


Regards.

P.S. I couldn't instrument `custom-slime-connect' for debugging, because
     of swank server moves faster than me while stepping.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: .swank
Type: application/octet-stream
Size: 303 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/slime-devel/attachments/20080815/53a79e4e/attachment.obj>


More information about the slime-devel mailing list