Fix #49 - force close socket to kill reader thread (was blocking in read)

This commit is contained in:
Kevin Hester
2021-01-03 20:55:01 +08:00
parent 5a56207440
commit 76f475d800
2 changed files with 29 additions and 14 deletions

11
tests/close-bug.py Normal file
View File

@@ -0,0 +1,11 @@
import sys
import meshtastic
import datetime, logging
from pubsub import pub
#logging.basicConfig(level=logging.DEBUG)
print(str(datetime.datetime.now()) + ": start")
interface = meshtastic.TCPInterface(sys.argv[1])
print(str(datetime.datetime.now()) + ": middle")
interface.close()
print(str(datetime.datetime.now()) + ": after close")