diff --git a/src/babashka/pods/impl.clj b/src/babashka/pods/impl.clj index 6d894ec..5c452a1 100644 --- a/src/babashka/pods/impl.clj +++ b/src/babashka/pods/impl.clj @@ -244,9 +244,11 @@ (Socket. hostname port)) (defn close-socket - "Close the socket, and also closes its input and output streams." + "Close the socket, and also closes its input and output streams. Returns nil." [^Socket socket] - (.close socket)) + (try (.close socket) + nil + (catch java.net.SocketException _ nil))) (defn port-file [pid] (io/file (str ".babashka-pod-" pid ".port")))