1 2[//000000001]: # (nameserv::auto \- Name service facility) 3[//000000002]: # (Generated from file 'nns\_auto\.man' by tcllib/doctools with format 'markdown') 4[//000000003]: # (Copyright © 2007\-2008 Andreas Kupries <andreas\_kupries@users\.sourceforge\.net>) 5[//000000004]: # (nameserv::auto\(n\) 0\.3 tcllib "Name service facility") 6 7<hr> [ <a href="../../../../toc.md">Main Table Of Contents</a> | <a 8href="../../../toc.md">Table Of Contents</a> | <a 9href="../../../../index.md">Keyword Index</a> | <a 10href="../../../../toc0.md">Categories</a> | <a 11href="../../../../toc1.md">Modules</a> | <a 12href="../../../../toc2.md">Applications</a> ] <hr> 13 14# NAME 15 16nameserv::auto \- Name service facility, Client Extension 17 18# <a name='toc'></a>Table Of Contents 19 20 - [Table Of Contents](#toc) 21 22 - [Synopsis](#synopsis) 23 24 - [Description](#section1) 25 26 - [API](#section2) 27 28 - [OPTIONS](#section3) 29 30 - [EVENTS](#section4) 31 32 - [DESIGN](#section5) 33 34 - [Bugs, Ideas, Feedback](#section6) 35 36 - [See Also](#seealso) 37 38 - [Keywords](#keywords) 39 40 - [Category](#category) 41 42 - [Copyright](#copyright) 43 44# <a name='synopsis'></a>SYNOPSIS 45 46package require Tcl 8\.4 47package require nameserv::auto ?0\.3? 48package require nameserv 49 50# <a name='description'></a>DESCRIPTION 51 52Please read the document *[Name service facility, 53introduction](nns\_intro\.md)* first\. 54 55This package provides the *exact* same API as is provided by package 56__[nameserv](nns\_client\.md)__, i\.e\. the regular name service client\. It 57differs from the former by taking measures to ensure that longer\-lived data, 58i\.e\. bound names, continuous and unfullfilled async searches, survive the loss 59of the connection to the name server as much as is possible\. 60 61This means that the bound names and continuous and unfullfilled async searches 62are remembered client\-side and automatically re\-entered into the server when the 63connection comes back after its loss\. For bound names there is one important 64limitation to such restoration: It is possible that a name of this client was 65bound by a different client while the connection was gone\. Such names are fully 66lost, and the best the package can and will do is to inform the user of this\. 67 68# <a name='section2'></a>API 69 70The user\-visible API is mainly identical to the API of 71__[nameserv](nns\_client\.md)__ and is therefore not described here\. 72Please read the documentation of __[nameserv](nns\_client\.md)__\. 73 74The differences are explained below, in the sections [OPTIONS](#section3) 75and [EVENTS](#section4)\. 76 77# <a name='section3'></a>OPTIONS 78 79This package supports all the options of package 80__[nameserv](nns\_client\.md)__, plus one more\. The additional option 81allows the user to specify the time interval between attempts to restore a lost 82connection\. 83 84 - __\-delay__ *milliseconds* 85 86 The value of this option is an integer value > 0 which specifies the 87 interval to wait between attempts to restore a lost connection, in 88 milliseconds\. The default value is __1000__, i\.e\. one second\. 89 90# <a name='section4'></a>EVENTS 91 92This package generates all of the events of package 93__[nameserv](nns\_client\.md)__, plus two more\. Both events are generated 94for the tag *[nameserv](nns\_client\.md)*\. 95 96 - *lost\-name* 97 98 This event is generated when a bound name is truly lost, i\.e\. could not be 99 restored after the temporary loss of the connection to the name server\. It 100 indicates that a different client took ownership of the name while this 101 client was out of contact\. 102 103 The detail information of the event will be a Tcl dictionary containing two 104 keys, __name__, and __data__\. Their values hold all the information 105 about the lost name\. 106 107 - *re\-connection* 108 109 This event is generated when the connection to the server is restored\. The 110 remembered data has been restored when the event is posted\. 111 112 The event has no detail information\. 113 114# <a name='section5'></a>DESIGN 115 116The package is implemented on top of the regular nameservice client, i\.e\. 117package __[nameserv](nns\_client\.md)__\. It detects the loss of the 118connection by listening for *lost\-connection* events, on the tag 119*[nameserv](nns\_client\.md)*\. 120 121It reacts to such events by starting a periodic timer and trying to reconnect to 122the server whenver this timer triggers\. On success the timer is canceled, a 123*re\-connection* event generated, and the package proceeds to re\-enter the 124remembered bound names and continuous searches\. 125 126Another loss of the connection, be it during or after re\-entering the remembered 127information simply restarts the timer and subsequent reconnection attempts\. 128 129# <a name='section6'></a>Bugs, Ideas, Feedback 130 131This document, and the package it describes, will undoubtedly contain bugs and 132other problems\. Please report such in the category *nameserv* of the [Tcllib 133Trackers](http://core\.tcl\.tk/tcllib/reportlist)\. Please also report any ideas 134for enhancements you may have for either package and/or documentation\. 135 136When proposing code changes, please provide *unified diffs*, i\.e the output of 137__diff \-u__\. 138 139Note further that *attachments* are strongly preferred over inlined patches\. 140Attachments can be made by going to the __Edit__ form of the ticket 141immediately after its creation, and then using the left\-most button in the 142secondary navigation bar\. 143 144# <a name='seealso'></a>SEE ALSO 145 146[nameserv\(n\)](nns\_client\.md) 147 148# <a name='keywords'></a>KEYWORDS 149 150[automatic](\.\./\.\./\.\./\.\./index\.md\#automatic), 151[client](\.\./\.\./\.\./\.\./index\.md\#client), [name 152service](\.\./\.\./\.\./\.\./index\.md\#name\_service), 153[reconnect](\.\./\.\./\.\./\.\./index\.md\#reconnect), 154[restore](\.\./\.\./\.\./\.\./index\.md\#restore) 155 156# <a name='category'></a>CATEGORY 157 158Networking 159 160# <a name='copyright'></a>COPYRIGHT 161 162Copyright © 2007\-2008 Andreas Kupries <andreas\_kupries@users\.sourceforge\.net> 163