ChrisVeigl / BrainBay

Open Source Biofeedback Software
http://brainbay.lo-res.org
Other
166 stars 52 forks source link

If BrainBay starts an OpenBCI Hub, kill it on exit #20

Closed wjcroft closed 5 years ago

wjcroft commented 5 years ago

Chris, hi. Apparently the philosophy of "leaving the Hub running in the background for other programs", that was promoted in the first versions of the Hub -- has been abandoned.

The OpenBCI GUI starts the Hub at the beginning of the session, then kills it when exiting.

BrainBay currently starts the Hub, but leaves it running on exit. This causes confusion if the user tries to start a GUI after a BrainBay session. The GUI starts a Hub again, and gets error (EADDRINUSE, 2nd Hub cannot bind to the fixed listening socket.)

I think the simplest answer for the moment is to just kill the Hub on BrainBay exit, if you have it's process id handy.

To be honest I think you are the only other program currently (in the known universe) ;-) which is using the Hub API. Apologies for the shifting sands...

Regards,

ChrisVeigl commented 5 years ago

ok - now the OpenBCIHub is terminated when Brainbay is closed or the Ganglion element is removed from the design.