sonos-java icon indicating copy to clipboard operation
sonos-java copied to clipboard

Initial discovery using the CLIController does not wait for responses

Open altery opened this issue 13 years ago • 1 comments

I ran the CLIController with the discover parameter. It seems (at least on OS X), that after the initial discovery of UPNP devices (startDiscovery()) , the sonos-java fails to wait for responses before executing the actual command(s) and I therefore usually get 0 recognised devices. I quickly screened the code and the MAX_DISCOVER_TIME_IN_MILLISECONDS constant seems to be used for the log message only. Hacking a dirty Thread.sleep() after startDiscovery() fixed the symptoms.

altery avatar Nov 29 '12 23:11 altery

Ok i'll correct the "discover" command, but not with a sleep there (the startDiscovery method is widely used, and on the other cases (regular commands) the discover is a bit more clover than that : the discovery is initiated with a max timeout, and the program ends either when all wanted commands on wanted zones are done (potentially before the global timeout), either if an expected zone hasn't been found, after that timeout (check the AbstractController.executeZoneCommands() with the zoneCommandDispatcher.waitEndExecution) - but the standalone discover command is a bit different and does not enter that mechanism.

SR-G avatar Dec 01 '12 13:12 SR-G