From ccb7870aa9505379479f121b4401145f790047b5 Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Tue, 28 Apr 2020 18:56:18 +0200 Subject: [PATCH] Close UNIX domain socket after handler send-recv --- source/connection/connection.d | 6 ++++++ source/temp.d | 6 ++++++ 2 files changed, 12 insertions(+) create mode 100644 source/temp.d diff --git a/source/connection/connection.d b/source/connection/connection.d index eadd2ea..430b135 100644 --- a/source/connection/connection.d +++ b/source/connection/connection.d @@ -125,6 +125,12 @@ public final class BesterConnection : Thread /* TODO: Implement error handling here and send a repsonse back (Issue: https://github.com/besterprotocol/besterd/issues/10) */ debugPrint("Error communicating with message handler"); } + finally + { + /* Always close the socket */ + handlerSocket.close(); + debugPrint("Closed UNIX domain socket to handler"); + } return response; } diff --git a/source/temp.d b/source/temp.d new file mode 100644 index 0000000..8cad182 --- /dev/null +++ b/source/temp.d @@ -0,0 +1,6 @@ + finally + { + /* Always close the socket */ + handlerSocket.close(); + debugPrint("Closed UNIX domain socket to handler"); + } \ No newline at end of file