From 6ca51c99c9fb40f19ba75e2c309ce149e8ac887f Mon Sep 17 00:00:00 2001 From: Josh Babb Date: Thu, 25 May 2023 13:49:14 -0500 Subject: [PATCH] destroy socket when done --- lib/electrumx_rpc/rpc2.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/electrumx_rpc/rpc2.dart b/lib/electrumx_rpc/rpc2.dart index 7bb382566..73f63e656 100644 --- a/lib/electrumx_rpc/rpc2.dart +++ b/lib/electrumx_rpc/rpc2.dart @@ -52,9 +52,10 @@ class JsonRPC { void _doneHandler() { Logging.instance.log( "JsonRPC doneHandler: " - "connection closed to ${_socket?.address}:${_socket?.port}", + "connection closed to ${_socket?.address}:${_socket?.port}, destroying socket", level: LogLevel.Info, ); + _socket?.destroy(); } Future _onReqCompleted(_JsonRPCRequest req) async {