Page 1 of 1

Phidget log error "non-MDNS server already exists"

Posted: Tue Dec 10, 2024 11:20 pm
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.

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

Posted: Wed Dec 11, 2024 1:42 pm
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