1[manpage_begin nameserv::server n 0.3.2] 2[copyright {2007-2008 Andreas Kupries <andreas_kupries@users.sourceforge.net>}] 3[moddesc {Name service facility}] 4[titledesc {Name service facility, Server}] 5[category Networking] 6[require Tcl 8.4] 7[require nameserv::server [opt 0.3.2]] 8[require comm] 9[require interp] 10[require logger] 11[keywords {name service} server] 12[see_also nameserv::common(n)] 13[see_also nameserv::client(n)] 14[description] 15 16Please read [term {Name service facility, introduction}] first. 17 18[para] 19 20This package provides an implementation of the serviver side of the 21name service facility queried by the client provided by the package 22[package nameserv]. All information required by the server will be 23held in memory. There is no persistent state. 24 25[para] 26 27This service is built in top of and for the package [package comm]. 28It has nothing to do with the Internet's Domain Name System. If the 29reader is looking for a package dealing with that please see Tcllib's 30packages [package dns] and [package resolv]. 31 32[para] 33 34This server supports the [term Core] protocol feature, and since 35version 0.3 the [term Search/Continuous] feature as well. 36 37 38[section API] 39 40The package exports five commands, as specified below: 41 42[list_begin definitions] 43 44[call [cmd ::nameserv::server::start]] 45 46This command starts the server and causes it to listen on the 47configured port. From now on clients are able to connect and make 48requests. The result of the command is the empty string. 49 50[para] 51 52Note that any incoming requests will only be handled if the 53application the server is part of does enter an event loop after this 54command has been run. 55 56 57[call [cmd ::nameserv::server::stop]] 58 59Invoking this command stops the server and releases all information it 60had. Existing connections are shut down, and no new connections will 61be accepted any longer. The result of the command is the empty string. 62 63 64[call [cmd ::nameserv::server::active?]] 65 66This command returns a boolean value indicating the state of the 67server. The result will be [const true] if the server is active, 68i.e. has been started, and [const false] otherwise. 69 70 71[call [cmd ::nameserv::server::cget] [option -option]] 72 73This command returns the currently configured value for the specified 74[option -option]. The list of supported options and their meaning can 75be found in section [sectref OPTIONS]. 76 77[call [cmd ::nameserv::server::configure]] 78 79In this form the command returns a dictionary of all supported 80options, and their current values. The list of supported options and 81their meaning can be found in section [sectref OPTIONS]. 82 83 84[call [cmd ::nameserv::server::configure] [option -option]] 85 86In this form the command is an alias for 87"[cmd ::nameserv::server::cget] [option -option]]". 88 89The list of supported options and their meaning can be found in 90section [sectref OPTIONS]. 91 92 93[call [cmd ::nameserv::server::configure] "[option -option] [arg value]..."] 94 95In this form the command is used to configure one or more of the 96supported options. At least one option has to be specified, and each 97option is followed by its new value. 98 99The list of supported options and their meaning can be found in 100section [sectref OPTIONS]. 101 102[para] 103 104This form can be used only if the server is not active, i.e. has not 105been started yet, or has been stopped. While the server is active it 106cannot be reconfigured. 107 108[list_end] 109 110 111[section OPTIONS] 112 113The options supported by the server are for the specification of the 114TCP port to listen on, and whether to accept non-local connections or 115not. 116 117They are: 118 119[list_begin options] 120[opt_def -localonly [arg bool]] 121 122This option specifies whether to accept only local connections 123(-localonly 1) or remote connections as well (-localonly 0). The 124default is to accept only local connections. 125 126[opt_def -port [arg number]] 127 128This option specifies the port the name service will listen on after 129it has been started. It has to be a positive integer number (> 0) not 130greater than 65536 (unsigned short). The initial default is the number 131returned by the command [cmd ::nameserv::server::common::port], as 132provided by the package [package ::nameserv::server::common]. 133 134[list_end] 135 136 137[section HISTORY] 138[list_begin definitions] 139[def 0.3] 140Extended the server with the ability to perform asynchronous and 141continuous searches. 142 143[def 0.2] 144Changed name of -local switch to -localonly. 145 146[def 0.1] 147Initial implementation of the server. 148[list_end] 149 150 151[section {BUGS, IDEAS, FEEDBACK}] 152 153This document, and the package it describes, will undoubtedly contain 154bugs and other problems. 155 156Please report such in the category [emph nameserv] of the 157[uri {http://sourceforge.net/tracker/?group_id=12883} {Tcllib SF Trackers}]. 158 159Please also report any ideas for enhancements you may have for either 160package and/or documentation. 161 162[manpage_end] 163