From aa8e6b160b6bed4dd385d86069325afceaaa8e5d Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Tue, 17 Dec 2019 12:23:34 +0100 Subject: [PATCH] Close socket --- src/babashka/wait.clj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/babashka/wait.clj b/src/babashka/wait.clj index dbf54d2b..af2cc9d4 100644 --- a/src/babashka/wait.clj +++ b/src/babashka/wait.clj @@ -17,8 +17,8 @@ opts) t0 (System/currentTimeMillis)] (loop [] - (let [v (try (Socket. host port) - (- (System/currentTimeMillis) t0) + (let [v (try (with-open [_ (Socket. host port)] + (- (System/currentTimeMillis) t0)) (catch ConnectException _e (let [took (- (System/currentTimeMillis) t0)] (if (and timeout (>= took timeout))