logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Net::Rendezvous::Publish - publish Rendezvous services

Author

       Richard Clamp <richardc@unixbeard.net>

Description

Methods

new
       Creates a new publisher handle

   publish(%definition)
       Returns a Net::Rendezvous::Publish::Service object.  The following keys are meaningful in the service
       definition hash.

       name
           A descriptive name for the service.

       type
           The type of service.  This is string of the form _service._protocol.

       port
           The port on which you're advertising the service.  If you're not using a port (and instead just using
           mDNS  as  a  way of propogating other service information) it's common practice to use 9 (the discard
           service)

       domain
           The domain in which to advertise a service.  Defaults to "local."

   step($seconds)
       Spend at most $seconds seconds handling network events and updating internal state.

Name

       Net::Rendezvous::Publish - publish Rendezvous services

See Also

       Net::Rendezous - for service browsing.

       Net::Rendezvous::Publish::Backend::* - you'll need one of these to talk to your local mDNS responder.

perl v5.40.1                                       2025-02-18                      Net::Rendezvous::Publish(3pm)

Synopsis

        use Net::Rendezvous::Publish;
        my $publisher = Net::Rendezvous::Publish->new
          or die "couldn't make a Responder object";
        my $service = $publisher->publish(
            name => "My HTTP Server",
            type => '_http._tcp',
            port => 12345,
        );
        while (1) { $publisher->step( 0.01 ) }

Todo

       At some point I may learn enough of the mDNS protocol to write a pure-perl responder.  That'll be nifty.

See Also