From 81689426e2f8fe6f4288273a872266667e4e60d2 Mon Sep 17 00:00:00 2001 From: Josh Babb Date: Wed, 24 May 2023 13:15:19 -0500 Subject: [PATCH] add logs --- lib/electrumx_rpc/rpc.dart | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/electrumx_rpc/rpc.dart b/lib/electrumx_rpc/rpc.dart index 1aba123e0..bf76f66bb 100644 --- a/lib/electrumx_rpc/rpc.dart +++ b/lib/electrumx_rpc/rpc.dart @@ -36,7 +36,10 @@ class JsonRPC { .log("JsonRPC json.decode: $e\n$s", level: LogLevel.Error); completer.completeError(e, s); } finally { - socket?.destroy(); + Logging.instance + .log("JsonRPC dataHandler: not destroying socket ${socket?.address}:${socket?.port}", level: LogLevel.Info); + // socket?.destroy(); + // TODO is this all we need to do? } } } @@ -45,11 +48,17 @@ class JsonRPC { Logging.instance .log("JsonRPC errorHandler: $error\n$trace", level: LogLevel.Error); completer.completeError(error, trace); - socket?.destroy(); + Logging.instance + .log("JsonRPC errorHandler: not destroying socket ${socket?.address}:${socket?.port}", level: LogLevel.Info); + // socket?.destroy(); + // TODO do we need to recreate the socket? } void doneHandler() { - socket?.destroy(); + Logging.instance + .log("JsonRPC doneHandler: not destroying socket ${socket?.address}:${socket?.port}", level: LogLevel.Info); + // socket?.destroy(); + // TODO is this all we need? } if (socket != null) {