1[manpage_begin nameserv::server n 0.3.2] 2[see_also nameserv::client(n)] 3[see_also nameserv::common(n)] 4[keywords {name service}] 5[keywords server] 6[copyright {2007-2008 Andreas Kupries <andreas_kupries@users.sourceforge.net>}] 7[moddesc {Name service facility}] 8[titledesc {Name service facility, Server}] 9[category Networking] 10[require Tcl 8.4] 11[require nameserv::server [opt 0.3.2]] 12[require comm] 13[require interp] 14[require logger] 15[description] 16 17Please read [term {Name service facility, introduction}] first. 18 19[para] 20 21This package provides an implementation of the serviver side of the 22name service facility queried by the client provided by the package 23[package nameserv]. All information required by the server will be 24held in memory. There is no persistent state. 25 26[para] 27 28This service is built in top of and for the package [package comm]. 29It has nothing to do with the Internet's Domain Name System. If the 30reader is looking for a package dealing with that please see Tcllib's 31packages [package dns] and [package resolv]. 32 33[para] 34 35This server supports the [term Core] protocol feature, and since 36version 0.3 the [term Search/Continuous] feature as well. 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[call [cmd ::nameserv::server::stop]] 57 58Invoking this command stops the server and releases all information it 59had. Existing connections are shut down, and no new connections will 60be accepted any longer. The result of the command is the empty string. 61 62[call [cmd ::nameserv::server::active?]] 63 64This command returns a boolean value indicating the state of the 65server. The result will be [const true] if the server is active, 66i.e. has been started, and [const false] otherwise. 67 68[call [cmd ::nameserv::server::cget] [option -option]] 69 70This command returns the currently configured value for the specified 71[option -option]. The list of supported options and their meaning can 72be found in section [sectref OPTIONS]. 73 74[call [cmd ::nameserv::server::configure]] 75 76In this form the command returns a dictionary of all supported 77options, and their current values. The list of supported options and 78their meaning can be found in section [sectref OPTIONS]. 79 80[call [cmd ::nameserv::server::configure] [option -option]] 81 82In this form the command is an alias for 83"[cmd ::nameserv::server::cget] [option -option]". 84 85The list of supported options and their meaning can be found in 86section [sectref OPTIONS]. 87 88[call [cmd ::nameserv::server::configure] "[option -option] [arg value]..."] 89 90In this form the command is used to configure one or more of the 91supported options. At least one option has to be specified, and each 92option is followed by its new value. 93 94The list of supported options and their meaning can be found in 95section [sectref OPTIONS]. 96 97[para] 98 99This form can be used only if the server is not active, i.e. has not 100been started yet, or has been stopped. While the server is active it 101cannot be reconfigured. 102 103[list_end] 104 105[section OPTIONS] 106 107The options supported by the server are for the specification of the 108TCP port to listen on, and whether to accept non-local connections or 109not. 110 111They are: 112 113[list_begin options] 114[opt_def -localonly [arg bool]] 115 116This option specifies whether to accept only local connections 117(-localonly 1) or remote connections as well (-localonly 0). The 118default is to accept only local connections. 119 120[opt_def -port [arg number]] 121 122This option specifies the port the name service will listen on after 123it has been started. It has to be a positive integer number (> 0) not 124greater than 65536 (unsigned short). The initial default is the number 125returned by the command [cmd ::nameserv::server::common::port], as 126provided by the package [package ::nameserv::server::common]. 127 128[list_end] 129 130[section HISTORY] 131[list_begin definitions] 132[def 0.3] 133Extended the server with the ability to perform asynchronous and 134continuous searches. 135 136[def 0.2] 137Changed name of -local switch to -localonly. 138 139[def 0.1] 140Initial implementation of the server. 141[list_end] 142 143[vset CATEGORY nameserv] 144[include ../common-text/feedback.inc] 145[manpage_end] 146