Keep a file descriptor reading the fifo instead of just opening and closing it
should take care of the sigpipe when no one is reading it anymore due to broken connection
This commit is contained in:
parent
0401029854
commit
3622443631
1 changed files with 2 additions and 1 deletions
|
@ -30,9 +30,10 @@ class OpenTrick(threading.Thread):
|
|||
def __init__(self, path):
|
||||
threading.Thread.__init__(self)
|
||||
self.path = path
|
||||
self.fd = None
|
||||
|
||||
def run(self):
|
||||
open(self.path, 'r', encoding='utf-8').close()
|
||||
self.fd = open(self.path, 'r', encoding='utf-8')
|
||||
|
||||
|
||||
class Fifo(object):
|
||||
|
|
Loading…
Reference in a new issue