1nameserv::auto(n) Name service facility nameserv::auto(n)
2
3
4
5______________________________________________________________________________
6
8 nameserv::auto - Name service facility, Client Extension
9
11 package require Tcl 8.4
12
13 package require nameserv::auto ?0.3?
14
15 package require nameserv
16
17______________________________________________________________________________
18
20 Please read the document Name service facility, introduction first.
21
22 This package provides the exact same API as is provided by package
23 nameserv, i.e. the regular name service client. It differs from the
24 former by taking measures to ensure that longer-lived data, i.e. bound
25 names, continuous and unfullfilled async searches, survive the loss of
26 the connection to the name server as much as is possible.
27
28 This means that the bound names and continuous and unfullfilled async
29 searches are remembered client-side and automatically re-entered into
30 the server when the connection comes back after its loss. For bound
31 names there is one important limitation to such restoration: It is pos‐
32 sible that a name of this client was bound by a different client while
33 the connection was gone. Such names are fully lost, and the best the
34 package can and will do is to inform the user of this.
35
37 The user-visible API is mainly identical to the API of nameserv and is
38 therefore not described here. Please read the documentation of name‐
39 serv.
40
41 The differences are explained below, in the sections OPTIONS and
42 EVENTS.
43
45 This package supports all the options of package nameserv, plus one
46 more. The additional option allows the user to specify the time inter‐
47 val between attempts to restore a lost connection.
48
49 -delay milliseconds
50 The value of this option is an integer value > 0 which specifies
51 the interval to wait between attempts to restore a lost connec‐
52 tion, in milliseconds. The default value is 1000, i.e. one sec‐
53 ond.
54
56 This package generates all of the events of package nameserv, plus two
57 more. Both events are generated for the tag nameserv.
58
59 lost-name
60 This event is generated when a bound name is truly lost, i.e.
61 could not be restored after the temporary loss of the connection
62 to the name server. It indicates that a different client took
63 ownership of the name while this client was out of contact.
64
65 The detail information of the event will be a Tcl dictionary
66 containing two keys, name, and data. Their values hold all the
67 information about the lost name.
68
69 re-connection
70 This event is generated when the connection to the server is
71 restored. The remembered data has been restored when the event
72 is posted.
73
74 The event has no detail information.
75
77 The package is implemented on top of the regular nameservice client,
78 i.e. package nameserv. It detects the loss of the connection by listen‐
79 ing for lost-connection events, on the tag nameserv.
80
81 It reacts to such events by starting a periodic timer and trying to
82 reconnect to the server whenver this timer triggers. On success the
83 timer is canceled, a re-connection event generated, and the package
84 proceeds to re-enter the remembered bound names and continuous
85 searches.
86
87 Another loss of the connection, be it during or after re-entering the
88 remembered information simply restarts the timer and subsequent recon‐
89 nection attempts.
90
92 This document, and the package it describes, will undoubtedly contain
93 bugs and other problems. Please report such in the category nameserv
94 of the Tcllib Trackers [http://core.tcl.tk/tcllib/reportlist]. Please
95 also report any ideas for enhancements you may have for either package
96 and/or documentation.
97
98 When proposing code changes, please provide unified diffs, i.e the out‐
99 put of diff -u.
100
101 Note further that attachments are strongly preferred over inlined
102 patches. Attachments can be made by going to the Edit form of the
103 ticket immediately after its creation, and then using the left-most
104 button in the secondary navigation bar.
105
107 nameserv(n)
108
110 automatic, client, name service, reconnect, restore
111
113 Networking
114
116 Copyright (c) 2007-2008 Andreas Kupries <andreas_kupries@users.sourceforge.net>
117
118
119
120
121tcllib 0.3 nameserv::auto(n)