resourcepool / ssdp-client

The most lightweight asynchronous Java SSDP (Simple Service Discovery Protocol) Client
Apache License 2.0
52 stars 21 forks source link

sendDiscoveryRequest may stop!!! #31

Closed hanxiao34 closed 2 years ago

hanxiao34 commented 2 years ago

image

loicortola commented 2 years ago

Hi! Thanks for the notification. Indeed, wasn't really paying attention to potential concurrent writes. I have handled a quick fix using a synchronized list as the only concurrent issues we might have should happen between the two single threaded executors in the code. As for the automatic lookup, makes sense. I've added a new SsdpClientOptions attribute called lookupAllIncomingAnnouncements. Default value is true for retrocompatibility. By using the Options builder method disableAutoLookup(), you will be able to have the expected behaviour.

Ships in 2.4.5 :)

loicortola commented 2 years ago

Feel free to close the issue when acknowledged ;)

hanxiao34 commented 2 years ago

In fact, I have encountered this concurrency problem. Thank you for solving it.