Phidget log error "non-MDNS server already exists"

Comments & issues
Supporting Windows 8 or newer
Post Reply
bkuehner
Phidgetsian
Posts: 10
Joined: Mon May 01, 2023 10:35 pm
Contact:

Phidget log error "non-MDNS server already exists"

Post by bkuehner »

I've recently enabled logging, and I've noticed errors like:
2024-12-10T20:26:53.283 <Info> phidget22net[deviceServerListener()] : Discovered server 'sbc-plants' [sbc-plants.local.] (interface 0xe)
2024-12-10T20:26:53.283 <Info> phidget22netctl[PhidgetNet_discoveredServer()] : Discovered Server: sbc-plants
2024-12-10T20:26:53.283 <ERROR> phidget22netctl[PhidgetNet_discoveredServer()] : non-MDNS server already exists 'sbc-plants.local.'
2024-12-10T20:26:53.283 <ERROR> phidget22net[deviceServerListener()] : failed to add MDNS server 'sbc-plants.local.': 0x0a - Object Exists

I do make calls to add those explicitly:
Net.AddServer("sbc-plants", "192.168.13.152", 5661, "", 0);

Is that a bad idea? Since I want the system to come up quickly after devices are powered on, I thought adding them via AddServer might speed it up vs waiting for discovery. I didn't think it would be a problem to have it added even if it was discoverable.
User avatar
Patrick
Lead Developer
Posts: 660
Joined: Mon Jun 20, 2005 8:46 am
Location: Calgary
Contact:

Re: Phidget log error "non-MDNS server already exists"

Post by Patrick »

Hi,

It's not a problem per se - server discovery is simply failing to add a connection to a server, because you have already added your own connection to that server. I would generally not recommend mixing enableServerDiscovery with also adding a discoverable server manually - if you are calling addServer anyway, do you also need server discovery to be enabled? It's good that you have chosen a server name that matches your severs name in addServer - otherwise the library would end up maintaining two connections to the same server.

-Patrick
Post Reply