From 97ba55bbf6246ce798f44871ca84a4e96c59167c Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Wed, 2 Feb 2022 19:51:04 +0200 Subject: [PATCH] Release the HTTP sessions --- json_rpc/clients/httpclient.nim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/json_rpc/clients/httpclient.nim b/json_rpc/clients/httpclient.nim index 9ec76b0..9986523 100644 --- a/json_rpc/clients/httpclient.nim +++ b/json_rpc/clients/httpclient.nim @@ -117,3 +117,7 @@ proc connect*(client: RpcHttpClient, address: string, port: Port, secure: bool) client.httpAddress = res else: raise newException(RpcAddressUnresolvableError, res.error) + +method close*(client: RpcHttpClient) {.async.} = + if not client.httpSession.isNil: + await client.httpSession.closeWait()