nameserv::auto(3tcl)

πŸ“¦
version 2.0 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– nameserv::auto β€” the manual page bestie πŸ’–

ok so you're here for nameserv::auto(3tcl), from the Name service facility family, and honestly? she's the upgrade arc. 🌸


✨ NAME ✨

nameserv::auto β€” Name service facility, Client Extension πŸŽ€


✨ SYNOPSIS ✨

package require Tcl 8.5 9

package require nameserv::auto ?0.4?

package require nameserv

✨ DESCRIPTION ✨

first things first bestie, go read Name service facility, introduction. like, actually read it. it's the prerequisite, no skipping. πŸ“š

ok so here's the tea: this package gives you the exact same API as nameserv, the regular name service client. literally the same. the glow-up is that she takes measures to make sure the long-lived stuff β€” bound names, continuous searches, and unfullfilled async searches β€” survives losing the connection to the name server as much as is possible. πŸ’ͺ

so what does that mean fr fr? it means the bound names and the continuous + unfullfilled async searches get remembered client-side, and they're automatically re-entered into the server when the connection comes back after its loss. iconic behaviour, she's so prepared. ✨

but β€” and this is the important bit β€” for bound names there's one important limitation to that restoration. it is possible that a name of this client was bound by a different client while the connection was gone. those names are fully lost, periodt. and the best the package can and will do is to inform the user of this. 😭 so don't say nobody warned you.


✨ API ✨

the user-visible API is mainly identical to the API of nameserv, so we're not describing it here. go read the documentation of nameserv. this page is just the diff. πŸ’…

the differences are explained below, in the sections OPTIONS and EVENTS.


✨ OPTIONS ✨

this package supports all the options of package nameserv, plus one more. the additional option lets the user specify the time interval between attempts to restore a lost connection. πŸ•

  • -delay milliseconds β€” the value of this option is an integer value > 0 which specifies the interval to wait between attempts to restore a lost connection, in milliseconds. the default value is 1000, i.e. one second.

✨ EVENTS ✨

this package generates all of the events of package nameserv, plus two more. both new events are generated for the tag nameserv. πŸ‘‘

  • lost-name β€” this event is generated when a bound name is truly lost, i.e. could not be restored after the temporary loss of the connection to the name server. it indicates that a different client took ownership of the name while this client was out of contact. πŸ’€

the detail information of the event will be a Tcl dictionary containing two keys, name, and data. their values hold all the information about the lost name.

  • re-connection β€” this event is generated when the connection to the server is restored. the remembered data has been restored when the event is posted. πŸ¦‹

the event has no detail information.


✨ DESIGN ✨

the package is implemented on top of the regular nameservice client, i.e. package nameserv. she detects the loss of the connection by listening for lost-connection events, on the tag nameserv. πŸ‘€

she reacts to such events by starting a periodic timer and trying to reconnect to the server whenver this timer triggers. on success the timer is canceled, a re-connection event generated, and the package proceeds to re-enter the remembered bound names and continuous searches. ✨

another loss of the connection β€” be it during or after re-entering the remembered information β€” simply restarts the timer and subsequent reconnection attempts. she's nothing if not persistent. πŸ’…


✨ BUGS, IDEAS, FEEDBACK ✨

this document, and the package it describes, will undoubtedly contain bugs and other problems. 😭 please report such in the category nameserv of the Tcllib Trackers [http://core.tcl.tk/tcllib/reportlist]. please also report any ideas for enhancements you may have for either package and/or documentation. we wanna hear it. 🫢

when proposing code changes, please provide unified diffs, i.e the output of diff -u.

note further that attachments are strongly preferred over inlined patches. attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar. do it that way, bestie, trust. πŸ™ˆ


✨ SEE ALSO ✨

  • nameserv(3tcl)

✨ KEYWORDS ✨

automatic, client, name service, reconnect, restore 🌈


✨ CATEGORY ✨

Networking


Copyright (c) 2007-2008 Andreas Kupries <andreas_kupries@users.sourceforge.net>


ok that's the whole page, you ate that. πŸ’– this one's from tcllib, version 0.4, and she's been serving since the nameserv::auto(3tcl) era β€” mwah, go reconnect to something, bestie. βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from