orsjb / HappyBrackets

HappyBrackets is an audio-focused library and toolkit for creative coding for the internet of things.
Apache License 2.0
36 stars 3 forks source link

When running device on localhost two instances of the device appear in the devices list #22

Closed orsjb closed 8 years ago

orsjb commented 8 years ago

Running the device (java -jar HB.jar) on my Mac, two instances of the device appear in the device list. Only one instance appears if I do this with WiFi off. i.e., it seems that the two different network connections (loopback and wifi) are being identified as two different devices.

Also device is outputting errors to do with not being able to read /etc/hostname, but I assume this is not a problem (though we used to know the hostname of the device).

orsjb commented 8 years ago

Solved. The device is indeed sending its status via two separate channels, leading to two exactly simultaneous calls which causes a bit of havoc. I've added a synchronized statement to the call so it must complete before running again.