Skip to content

Not able to set TLL in mDNS library #3338

Closed
@cansik

Description

@cansik

As written in the readme of the mDNS library, there should be a parameter to set the time to live (TTL) for the DNS entry:

image
mDNS Readme

But there is not parameter to set TLL and if you take a look at the source code, there is a constant value of 1 (shouldn't it be seconds?!).

static const int MDNS_MULTICAST_TTL = 1;

I could not find the source code for UdpContext, which receives this constant value. Does it receive seconds or hours?

if (!_conn->listen(*IP_ADDR_ANY, MDNS_PORT)) {
      return false;
    }
    _conn->setMulticastTTL(MDNS_MULTICAST_TTL);
    _conn->onRx(std::bind(&MDNSResponder::update, this));
    _conn->connect(multicast_addr, MDNS_PORT);

ESP8266mDNS.cpp#L2

What do you think about a method overload to define the TTL?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions