From 61ed9798de9761d97282e312f0bed6b664aa5005 Mon Sep 17 00:00:00 2001 From: Jason Dana Date: Fri, 5 Feb 2016 12:37:14 -0500 Subject: [PATCH] Only close SocketWatcher when capturing live --- pcap.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pcap.js b/pcap.js index 345986c1..cd314392 100644 --- a/pcap.js +++ b/pcap.js @@ -102,7 +102,9 @@ PcapSession.prototype.on_packet_ready = function () { PcapSession.prototype.close = function () { this.opened = false; this.session.close(); - this.readWatcher.stop(); + if (this.is_live) { + this.readWatcher.stop(); + } // TODO - remove listeners so program will exit I guess? };