emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/sly 5b26eb9a3c 1/5: Clasp uses the USE-VALUE restart to cy


From: ELPA Syncer
Subject: [nongnu] elpa/sly 5b26eb9a3c 1/5: Clasp uses the USE-VALUE restart to cycle ports
Date: Wed, 13 Jul 2022 10:59:18 -0400 (EDT)

branch: elpa/sly
commit 5b26eb9a3ca0bd24d42c6882372443a058d5b627
Author: Christian Schafmeister <chris.schaf@verizon.net>
Commit: João Távora <joaotavora@gmail.com>

    Clasp uses the USE-VALUE restart to cycle ports
    
    Slime has a feature to cycle through ports until a free one is
    found.  I added code so that Clasp takes advantage of this feature.
    
    Cherry-picked-from: SLIME commit 98a656d96b177edce57b552a2fa9d139cdce8c9a
---
 slynk/backend/clasp.lisp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/slynk/backend/clasp.lisp b/slynk/backend/clasp.lisp
index d979223d5c..1cb7807f8c 100644
--- a/slynk/backend/clasp.lisp
+++ b/slynk/backend/clasp.lisp
@@ -64,7 +64,11 @@
                               :type :stream
                               :protocol :tcp)))
     (setf (sb-bsd-sockets:sockopt-reuse-address socket) t)
-    (sb-bsd-sockets:socket-bind socket (resolve-hostname host) port)
+    (handler-bind
+        ((SB-BSD-SOCKETS:ADDRESS-IN-USE-ERROR (lambda (err)
+                                                (declare (ignore err))
+                                               (invoke-restart 'use-value))))
+      (sb-bsd-sockets:socket-bind socket (resolve-hostname host) port))
     (sb-bsd-sockets:socket-listen socket (or backlog 5))
     socket))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]