Closed mwgkgk closed 4 years ago
This restart problem can be solved for both restart-hard
and restart-soft
by simply making sure vlime:main
is only called once.
(ql:quickload :vlime)
(when (not (boundp '*vlime-loaded*))
(vlime:main :interface #(127 0 0 1)
;; TODO pick a free port automatically and use :port-file
:port 7002
:backend :vlime-usocket)
(defvar *vlime-loaded* t))
This lets the connection persist between restarts, so no additional Vim-side hackery is needed.
As such, closing the connection from the server side is not something that was needed. Closing the issue.
Problem: StumpWM restart (including forced one on certain errors) complains the (hardcoded) socket is busy and the whole thing hangs. A sane way of dealing with this would be to use some machinery that would pick a free socket when running
vlime:main
.However, there's also a
*restart-hook*
that we could use to perhaps close the connection or, handle the situation more gracefully in some other way. The closest thing I've found isconnection-close
fromvlime-connection.lisp
, which requires a connection object, which however I'm not sure how to acquire:vlime:main
seems to returnnil
.Additionally, both these approaches would require handling the interrupted connection on the Vim side, which I'm also not sure how to best do.
Will be grateful for any suggestions :)