nameserv::auto(n)
πΈ nameserv::auto β the manual, but make it make sense π
okay bestie, so this is page nameserv::auto(n) from the tcllib collection, and honestly? it's giving "your fave client, but with abandonment issues (affectionate)". let's get into it π«Ά
β¨ NAME β¨
nameserv::auto β Name service facility, Client Extension. yes she's an extension. yes she's that girl. π
β¨ SYNOPSIS β¨
package require Tcl 8.5 9
package require nameserv::auto ?0.4?
package require nameserv
β¨ DESCRIPTION β¨
okay so first things first, queen: go read the doc Name service facility, introduction before you read this one. fr fr, it's the prerequisite. π
so this package? it hands you the exact same API as the package nameserv, like, the regular name service client. no notes on the API itself. BUT β and this is the whole personality β it goes the extra mile to make sure your longer-lived data survives when the connection to the name server ghosts you. we're talking:
- bound names
- continuous searches
- unfullfilled async searches
she keeps those alive as much as is humanly (and technically) possible. π
what that actually means: the bound names and the continuous + unfullfilled async searches get remembered client-side, and then automatically re-entered into the server once the connection comes back after being lost. iconic behavior, honestly.
but bestie, there's one important limitation on restoring bound names and I need you to hear me: it is possible that one of this client's names got bound by a different client while the connection was gone. names like that are fully lost. the absolute best this package can do β and the thing it will do β is tell the user about it. that's it. that's the ceiling. π
β¨ API β¨
the user-visible API is mainly identical to the API of nameserv, so it's not getting described here. go read the docs for nameserv. she's not repeating herself, she's efficient. π
the differences? they're down below in the OPTIONS and EVENTS sections. keep scrolling.
β¨ OPTIONS β¨
this package supports all the options of package nameserv, plus exactly one more. and the bonus option lets you set the time interval between attempts to restore a lost connection. so thoughtful of her. π
-delay millisecondsβ the value of this option is an integer value > 0, and it specifies the interval to wait between attempts to restore a lost connection, measured in milliseconds. the default value is 1000, i.e. one second. so if you do nothing, she's checking back every second. loyal. β
β¨ EVENTS β¨
this package generates all of the events of package nameserv, plus two more. both of these extra events are generated for the tag nameserv. π¦
lost-nameβ this event fires when a bound name is truly lost, i.e. it could not be restored after the temporary loss of the connection to the name server. it's the signal that a different client took ownership of the name while this client was out of contact. the detail information of the event is a Tcl dictionary containing two keys,name, anddata. their values hold all the information about the lost name. rip to that name honestly πre-connectionβ this event fires when the connection to the server is restored. and here's the cute part: the remembered data has already been restored by the time the event is posted. the event has no detail information. she just shows up to say "we're so back". π
β¨ DESIGN β¨
so how is she built? 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. π
her reaction to those events: she starts a periodic timer and tries to reconnect to the server whenever this timer triggers. on success she cancels the timer, generates a re-connection event, and then proceeds to re-enter the remembered bound names and continuous searches. slay. β¨
and if the connection drops again β whether that's during or after re-entering the remembered information β she simply restarts the timer and the subsequent reconnection attempts. no drama, just persistence. periodt. π
β¨ BUGS, IDEAS, FEEDBACK β¨
ngl, this document and the package it describes will undoubtedly contain bugs and other problems. it's giving "we're all just doing our best". π
please report such bugs in the category nameserv of the Tcllib Trackers:
http://core.tcl.tk/tcllib/reportlist
also please report any ideas for enhancements you may have for either the package and/or the documentation. we love ideas. we eat ideas for breakfast. π
when you propose code changes, please provide unified diffs, i.e the output of diff -u. no freestyling.
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. iykyk.
β¨ SEE ALSO β¨
nameserv(n)
β¨ KEYWORDS β¨
automatic, client, name service, reconnect, restore πΈ
β¨ CATEGORY β¨
Networking
β¨ COPYRIGHT β¨
Copyright (c) 2007-2008 Andreas Kupries <andreas_kupries@users.sourceforge.net>
and that's the whole page, bestie π₯° this came from tcllib, version 0.4, of nameserv::auto(n) β go forth, keep your bound names safe, and remember: if the connection drops, she's already on it. mwah π
π¦ where this page comes from
- fedora 43: tcllib 2.0-3.fc43 Β· TCL
- fedora 44: tcllib 2.0-4.fc44 Β· TCL
- nixos 26.05: tcllib 2.0
- nixpkgs unstable: tcllib 2.0
- Copyright (c) 2007-2008 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms