Skip to content

Commit 4634a39

Browse files
author
Assel Meher
committed
Merge pull request #199 from jasondana/offline-close
Only close SocketWatcher when capturing live
2 parents cfba7be + 61ed979 commit 4634a39

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

pcap.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ PcapSession.prototype.on_packet_ready = function () {
102102
PcapSession.prototype.close = function () {
103103
this.opened = false;
104104
this.session.close();
105-
this.readWatcher.stop();
105+
if (this.is_live) {
106+
this.readWatcher.stop();
107+
}
106108
// TODO - remove listeners so program will exit I guess?
107109
};
108110

0 commit comments

Comments
 (0)