Tcl Library Source Code

EuroTcl/OpenACS 11 - 12 JULY 2024, VIENNA

[ Main Table Of Contents | Table Of Contents | Keyword Index | Categories | Modules | Applications ]


nameserv - Name service facility, Client

Table Of Contents


package require Tcl 8.5 9
package require nameserv ?0.4.3?
package require comm
package require logger

::nameserv::bind name data
::nameserv::search ?-async|-continuous? ?pattern?
::nameserv::cget -option
::nameserv::configure -option
::nameserv::configure -option value...
$result destroy
$result filled
$result get name
$result names
$result size
$result getall ?pattern?


Please read Name service facility, introduction first.

This package provides a client for the name service facility implemented by the package nameserv::server.

This service is built in top of and for the package comm. It has nothing to do with the Internet's Domain Name System. If the reader is looking for a package dealing with that please see Tcllib's packages dns and resolv.


The package exports eight commands, as specified below:


The client automatically connects to the service when one of the commands below is run for the first time, or whenever one of the commands is run after the connection was lost, when it was lost.

Since version 0.2 of the client it will generate an event when the connection is lost, allowing higher layers to perform additional actions. This is done via the support package uevent. This and all other name service related packages hereby reserve the uevent-tag nameserv. All their events will be posted to that tag.


This package generates only one event, lost-connection. The detail information provided to that event is a Tcl dictionary. The only key contained in the dictionnary is reason, and its value will be a string describing why the connection was lost. This string is supplied by the underlying communication package, i.e. comm.


The options supported by the client are for the specification of which name service to contact, i.e. of the location of the name service. They are:


Asynchronous and continuous searches are invoked by using either option -async or -continuous as argument to the command ::nameserv::search.

Note that these two options are supported if and only if the service the client is connected to supports the protocol feature Search/Continuous. The service provided by the package ::nameserv::server does this since version 0.3.

For such searches the result of the search command is the Tcl command of an object holding the actual result. The API provided by these objects is:


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. 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.


nameserv::common(n), nameserv::server(n)


client, name service




Copyright © 2007-2008 Andreas Kupries