Close socket
This commit is contained in:
parent
c2d9bbfab2
commit
aa8e6b160b
1 changed files with 2 additions and 2 deletions
|
|
@ -17,8 +17,8 @@
|
||||||
opts)
|
opts)
|
||||||
t0 (System/currentTimeMillis)]
|
t0 (System/currentTimeMillis)]
|
||||||
(loop []
|
(loop []
|
||||||
(let [v (try (Socket. host port)
|
(let [v (try (with-open [_ (Socket. host port)]
|
||||||
(- (System/currentTimeMillis) t0)
|
(- (System/currentTimeMillis) t0))
|
||||||
(catch ConnectException _e
|
(catch ConnectException _e
|
||||||
(let [took (- (System/currentTimeMillis) t0)]
|
(let [took (- (System/currentTimeMillis) t0)]
|
||||||
(if (and timeout (>= took timeout))
|
(if (and timeout (>= took timeout))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue