Skip to content

Commit

Permalink
mDNS entry now uses IP_PORT and WIFI_HOSTNAME
Browse files Browse the repository at this point in the history
  • Loading branch information
pmantoine committed Feb 1, 2024
1 parent d1f558d commit c0f69cd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions EthernetInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,23 +187,24 @@ bool EthernetInterface::checkLink() {
}
LCD(4,F("IP: %d.%d.%d.%d"), ip[0], ip[1], ip[2], ip[3]);
LCD(5,F("Port:%d"), IP_PORT);
mdns.begin(Ethernet.localIP(), "dccex"); // hostname
mdns.addServiceRecord("dccex._withrottle", 2560, MDNSServiceTCP);
mdns.begin(Ethernet.localIP(), WIFI_HOSTNAME); // hostname
mdns.addServiceRecord(WIFI_HOSTNAME "._withrottle", IP_PORT, MDNSServiceTCP);
// only create a outboundRing it none exists, this may happen if the cable
// gets disconnected and connected again
if(!outboundRing)
outboundRing=new RingStream(OUTBOUND_RING_SIZE);
}
return true;
} else { // LinkOFF
if (connected) {
if (connected) { // Were connected, but no longer without a LINK!
DIAG(F("Ethernet cable disconnected"));
connected=false;
//clean up any client
for (byte socket = 0; socket < MAX_SOCK_NUM; socket++) {
if(clients[socket].connected())
clients[socket].stop();
}
mdns.removeServiceRecord(IP_PORT, MDNSServiceTCP);
// tear down server
delete server;
server = nullptr;
Expand Down

0 comments on commit c0f69cd

Please sign in to comment.