Net::R...ublish(3pm)

πŸ“¦
version 0.04 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu noble

πŸ’– Net::Rendezvous::Publish(3pm) πŸ’–

okay bestie, so this is a page from the User Contributed Perl Documentation, and it's about one very specific slay: publishing Rendezvous services. no cap. let's get into it πŸ¦‹


✨ NAME ✨

Net::Rendezvous::Publish β€” publish Rendezvous services πŸŽ€


🌸 SYNOPSIS 🌸

like, here's the whole vibe in one go:

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 ) }

πŸ’… DESCRIPTION πŸ’…

okay so this section is literally empty in the original. it's giving minimalism. it's giving "the METHODS section is right there, babes". nothing to see, moving on πŸ‘‘


🫢 METHODS 🫢

new 🌟

Creates a new publisher handle. that's it, that's the whole thing. iconic behaviour honestly.

publish( %definition ) πŸŽ€

Returns a Net::Rendezvous::Publish::Service object. bestie, the following keys are the ones that actually mean something in the service definition hash:

  • name β€” a descriptive name for the service. you know, the cute label ✨
  • type β€” the type of service. this is a string of the form _service._protocol.
  • port β€” the port you're advertising the service on. and listen, 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). yes, nine. the discard service. that's the move πŸ’€
  • domain β€” the domain in which to advertise a service. defaults to "local." (period included, she's specific like that).

step( $seconds ) πŸ¦‹

Spend at most $seconds seconds handling network events and updating internal state. so like, you hand her a time budget and she uses up to that much. no more. she's disciplined πŸ’–


🌈 TODO 🌈

At some point the author may learn enough of the mDNS protocol to write a pure-perl responder. and per the page itself: "That'll be nifty." fr fr, nifty is underselling it 😭


πŸ‘‘ AUTHOR πŸ‘‘

Richard Clamp <richardc@unixbeard.net>


Copyright 2004, 2005, 2006, Richard Clamp. All Rights Reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


⭐ SEE ALSO ⭐

  • Net::Rendezous β€” for service browsing. (yes, that's the spelling on the page, bestie, we don't touch it, we don't fix it, we respect it 🫑)
  • Net::Rendezvous::Publish::Backend::* β€” you'll need one of these to talk to your local mDNS responder. like, you need one. it's not optional. the * is doing a lot of heavy lifting here and we love her for it.

and that's the whole page, periodt πŸ’… this was Net::R...ublish(3pm), perl v5.34.0, dated 2022-06-30 β€” tysm for reading, ily, go publish something cute πŸŽ€βœ¨πŸ’–

πŸ“¦ where this page comes from