# NetworkServiceDiscovery: multiple listeners on same machine

**URL:** https://forum.juce.com/t/networkservicediscovery-multiple-listeners-on-same-machine/66306
**Category:** General JUCE discussion
**Created:** [June 7, 2025, 6:24pm UTC](https://forum.juce.com/t/networkservicediscovery-multiple-listeners-on-same-machine/66306 "2025-06-07T18:24:11Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![danielrudrich](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/danielrudrich/32/3735_2.png) [@danielrudrich](https://forum.juce.com/u/danielrudrich)
#### Post date: [June 7, 2025, 6:24pm UTC](https://forum.juce.com/t/networkservicediscovery-multiple-listeners-on-same-machine/66306/1 "2025-06-07T18:24:11Z")

</div>

I have the following use case: a main application which can be running on the same machine or one in the network, and several smaller satellite applications which want to connect to the main one. I am currently investigating if NetworkServiceDiscovery can be a solution for that.

However I have the following problem:  
With multiple listeners (`AvailableServiceList` instance) running on the **same** machine, only the first one will find the service, as the first one will block the second one to bind to the broadcast port.

With the following addition to the AvailableServiceList’s constructor I can make it work with several listeners on the same machine:

```cpp
// AvailableServicesList constructor
    socket.setEnablePortReuse (true); // <--this
    socket.bindToPort (broadcastPort);

```

Is there a reason why the socket is **not** configured for port-reuse? I’ve tested this on macOS, so maybe it won’t work on other platforms?

---

<div class="post-metadata">

### Author: ![suelliman](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@suelliman](https://forum.juce.com/u/suelliman)
#### Post date: [November 24, 2025, 1:43pm UTC](https://forum.juce.com/t/networkservicediscovery-multiple-listeners-on-same-machine/66306/2 "2025-11-24T13:43:24Z")

</div>

It doesn’t work on Windows (binding will succeed, but the second client still won’t receive anything)
