nameserv::auto -
Name service facility, Client Extension
package require Tcl 8.4
package require nameserv::auto ? 0.1 ?
package require nameserv
::nameserv::auto::bind name data
::nameserv::auto::cget -option
::nameserv::auto::configure
::nameserv::auto::configure -option
::nameserv::auto::configure -option value...
This package sits on top of the regular name service client
(
nameserv) and provides automatic restoration of a lost
connection, and automatic rebinding of name/data pairs. The latter is
however restricted to names which registered through this package
instead of the regular client.
It does this by watching for the lost-connection events
generated by nameserv and then trying to reconnect every
N milliseconds (configurable, default is 1000, i.e. 1
second).
An important case to detect and handle is where a registered name was
bound by a different client in the interval between loss and
restoration of the connection.
When that happens an automatic rebinding is not possible anymore for
the specific name/data pair. This package will generate a
lost-name event (tag nameserv) for all such names.
The detail information of these events will be a Tcl dictionary
containing two keys, name, and data, whose values hold
the information of the lost pair.
The package exports three commands, as specified below:
-
::nameserv::auto::bind name data
-
This command is identical to ::nameserv::bind of package
nameserv, except that it remembers the name/data
information and rebinds them automatically when a lost connection is
restored.
-
::nameserv::auto::cget -option
-
This command returns the currently configured value for the specified
-option. The list of supported options and their meaning can
be found in section OPTIONS.
-
::nameserv::auto::configure
-
In this form the command returns a dictionary of all supported
options, and their current values. The list of supported options and
their meaning can be found in section OPTIONS.
-
::nameserv::auto::configure -option
-
In this form the command is an alias for
"::nameserv::auto::cget -option]".
The list of supported options and their meaning can be found in
section OPTIONS.
-
::nameserv::auto::configure -option value...
-
In this form the command is used to configure one or more of the
supported options. At least one option has to be specified, and each
option is followed by its new value.
The list of supported options and their meaning can be found in
section OPTIONS.
The one option supported by the auto-client specifies the time
interval between attempts to restore a lost connection.
It is:
-
-delay milliseconds
-
This option specifies the interval to wait between attempts to restore
a lost connection, in milliseconds. The default value is 1000,
i.e. one second.
This document, and the package it describes, will undoubtedly contain
bugs and other problems.
Please report such in the category
nameserv of the
http://sourceforge.net/tracker/?group_id=12883.
Please also report any ideas for enhancements you may have for either
package and/or documentation.
nameserv(n)
name service, client, restore, reconnect, automatic