Skip to content

Instantly share code, notes, and snippets.

@adlai
Created February 5, 2021 15:48
Show Gist options
  • Save adlai/ca2c80c9a4b8079be1d604b518c4a6e5 to your computer and use it in GitHub Desktop.
Save adlai/ca2c80c9a4b8079be1d604b518c4a6e5 to your computer and use it in GitHub Desktop.
SLIME+CCL socket example
;;; then, append these to your initfile:
(format t "~&Where to listen for swank? (blank = none) ")
(finish-output)
(let* ((answer (read-line))
(number (parse-integer answer :junk-allowed t)))
(cond
(number (swank:create-server :port number :dont-close t))
((string/= answer "") (swank:create-server :port answer :dont-close t))))
;;; first, edit two of the functions in swank/ccl.lisp, to this:
(defimplementation create-socket (host port &key backlog)
(multiple-value-call #'ccl:make-socket
:connect :passive :local-host host :backlog (or backlog 5)
(if (typep port 'integer) (values :reuse-address t :local-port port)
(values :local-filename port :address-family :file))))
(defimplementation local-port (socket) (defimplementation local-port (socket)
(or (ccl:local-port socket) (ccl:local-filename socket)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment