nns_intro(n)
β¨ NAME β¨
okay so bestie, welcome to nns_intro β it's the whole Name service facility, introduction, and yes it's giving "read me first" main character energy π
πΈ DESCRIPTION πΈ
nns (short for nano nameservice, iconic name, no notes) is a facility built for the package comm, and what it does is add a simple name service to it. It's also built on top of comm, using it to pass messages back and forth between the client part and the server part. slay.
okay real talk though: this name service facility has literally nothing to do with the Internet's Domain Name System, aka DNS. not a thing. if that's what you came here for, bestie you're in the wrong group chat β go look at either of the packages dns and resolv, both of which are also found in Tcllib. π
Tcllib provides 2 applications and 4 packages that all work together and give you access to the facility at different levels. π¦
π APPLICATIONS π
The application nnsd provides a simple name server which can be run by anybody anywhere on their system, as they see fit. It's also, lowkey, an example of how to use the server-side package nameserv::server. π
Complementing this server is the nns client application. A possible β but ngl not very sensible β use would be to enter name/port bindings into a server from a shell script. Not sensible, because shell scripts normally do not provide a comm-based service. π
The only case where this makes some sense would be in a shell script wrapped around a Tcl script FOO which is using comm, to register the listening port used by FOO. But even there it would be much more sensible to extend FOO to use the nameservice directly. And as for how to do that β nns can be used as both example and template. Beyond that, it may also be useful to perform nameservice queries from shell scripts.
The third application, nnslog, is a stripped down form of the nns client application. It's reduced to performing a continuous search for all changes, and it logs all received events to stdout. π
Both clients use the nameserv::auto package to automatically handle the loss and restoration of the connection to the server. no cap, it just does it for you.
π§ PACKAGES π§
The two main packages implementing the service are nameserv and nameserv::server, i.e. client and server. The latter has not much of an API β just enough to start, stop, and configure it. See the application nnsd on how to use it. π«
The basic client, in package nameserv, provides the main API to manipulate and query the service. An example of its use is the application nns. π
The second client package, nameserv::auto, is API compatible to the basic client, but provides the additional functionality that it will automatically restore data like bound names when the connection to the name service was lost and then reestablished. I.e. it automatically detects the loss of the server and re-enters the data when the server comes back. auto-heal era, we love to see it. π«Ά
The package nameserv::common is of no interest to users. It's an internal package containing code and definitions common to the packages nameserv and nameserv::server. literally not your business bestie, and that's fine.
All packages use the uevent package for the reporting of special circumstances via events, and they reserve the uevent-tag nameserv for their exclusive use. All their events will be posted to that tag. π·οΈ
π₯ INTERNALS π₯
The document Name service facility, client/server protocol specifies the protocol used by the packages nameserv and nameserv::server to talk to each other. It is of no interest to users of either the packages or applications.
Developers wishing to modify and/or extend, or to just understand the internals of the nameservice facility, however, are strongly advised to read it. ππ
π 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. π
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. π―
π¦ SEE ALSO π¦
nameserv(n)nameserv::auto(n)nameserv::common(n)nameserv::protocol(n)nameserv::server(n)nnsd(n)nss(n)
β KEYWORDS β
client, name service, server
π CATEGORY π
Networking
πΈ COPYRIGHT πΈ
Copyright (c) 2008 Andreas Kupries <andreas_kupries@users.sourceforge.net>
and that's the whole page bestie, you ate it π β¨
kisses, this was tcllib version 1.0 of the nns_intro(n) page β thanks for reading all the way to the end, ily, go build something cute ππ«Ά
π¦ where this page comes from
- alpine 3.24: tcl-lib-doc 1.21-r1 Β· BSD-2-Clause
- epel 9: tcllib 1.21-1.el9 Β· BSD
- 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
- opensuse-leap 16.0: tcllib 1.21-bp160.1.2 Β· TCL
- Copyright (c) 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