Skip to content

Commit

Permalink
Merge pull request #11 from PaulWieland/master
Browse files Browse the repository at this point in the history
Addresses the reconnect issue and 100% CPU consumption after disconnect
  • Loading branch information
ckdo committed Mar 3, 2021
2 parents 722ee76 + e39758a commit cf2d54c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,15 @@ To run the receiver please use Python 3 and do the following:
* Run the following commands

```zsh
brew install python3
brew install portaudio
virtualenv proto
virtualenv -p /usr/local/bin/python3 proto
source proto/bin/activate
pip install -r requirements.txt
pip install --global-option=build_ext --global-option="-I/usr/local/Cellar/portaudio/19.6.0/include" --global-option="-L/usr/local/Cellar/portaudio/19.6.0/lib" pyaudio


python ap2-receiver.py -m myap2
python ap2-receiver.py -m myap2 --netiface=en0
```

## Windows
Expand Down
6 changes: 6 additions & 0 deletions ap2-receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,12 @@ def do_TEARDOWN(self):
self.send_header("Server", self.version_string())
self.send_header("CSeq", self.headers["CSeq"])
self.end_headers()

# Erase the hap() instance, otherwise reconnects fail
self.server.hap = None

# terminate the forked event_proc, otherwise a zombie process consumes 100% cpu
self.event_proc.terminate()

def do_SETPEERS(self):
print("SETPEERS %s" % self.path)
Expand Down

0 comments on commit cf2d54c

Please sign in to comment.