nameserv::server(3tcl)
π nameserv::server β the manual page, but make it a group chat π
okay bestie, welcome to nameserv::server(3tcl), aka the server half of the Tcllib Name service facility π. yes it's a real manual page, yes it's from the Name service facility section, and yes we are about to read it together like it's the most iconic thing ever. because it is. π
β¨ NAME β¨
nameserv::server β Name service facility, Server. that's it, that's the name, she's serving π
β¨ SYNOPSIS β¨
package require Tcl 8.5 9
package require nameserv::server ?0.3.3?
package require comm
package require interp
package require logger
::nameserv::server::start
::nameserv::server::stop
::nameserv::server::active?
::nameserv::server::cget -option
::nameserv::server::configure
::nameserv::server::configure -option
::nameserv::server::configure -option value...
no cap, those are the exact lines, copy-paste responsibly π«Ά
β¨ DESCRIPTION β¨
okay so first things first: please read Name service facility, introduction first. it's giving prerequisite, it's giving syllabus day, but trust, it helps π
this package is the server side of the name service facility β the one the client from the package nameserv goes and queries. all the information the server needs? held in memory. there is no persistent state. she lives in the moment, she does not journal, periodt β¨
this service is built on top of β and for β the package comm. and bestie, listen: it has nothing to do with the Internet's Domain Name System. like, zero. different thing entirely π if you were looking for the package that deals with that, go look at Tcllib's packages dns and resolv. not us. never was us.
this server supports the Core protocol feature, and since version 0.3 it does the Search/Continuous feature too. glow up achieved π
β¨ API β¨
the package exports five commands. five. count them. iconic behavior honestly π
::nameserv::server::startβ this one starts the server and makes it listen on the configured port. from that moment on, clients can connect and make requests. the result of the command is the empty string.
not me reminding you: any incoming requests will only actually get handled if the application the server is part of enters an event loop after this command has been run. no event loop, no vibes, no service π
::nameserv::server::stopβ invoking this stops the server and releases all the information it had. existing connections are shut down, and no new connections will be accepted any longer. the result of the command is the empty string. it's giving cleanup era π§Ή::nameserv::server::active?β returns a boolean value telling you the state of the server. result is true if the server is active (i.e. has been started), and false otherwise. the vibe check command, fr fr β¨::nameserv::server::cget -optionβ returns the currently configured value for the specified-option. the list of supported options and what they mean lives in the OPTIONS section, go look π::nameserv::server::configureβ in this form, the command returns a dictionary of all supported options and their current values. again, supported options and their meaning: OPTIONS section. she's a whole mood board of settings π::nameserv::server::configure -optionβ in this form it's literally just an alias for"::nameserv::server::cget -option". same energy. supported options and meaning? you already know. OPTIONS. π::nameserv::server::configure -option value...β in this form you're using it 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. and yes, supported options and their meaning are in OPTIONS β we've been here, we love it here.
β οΈ this form can be used only if the server is not active, i.e. it has not been started yet, or it has been stopped. while the server is active it cannot be reconfigured. she is booked and busy, do not disturb π
β¨ OPTIONS β¨
the options supported by the server are for specifying the TCP port to listen on, and whether to accept non-local connections or not. so, two things. two little settings. here they are:
-localonlybool β specifies whether to accept only local connections (-localonly 1) or remote connections as well (-localonly 0). the default is to accept only local connections. stay in your lane, stay local, love that for you π¦-portnumber β specifies the port the name service will listen on after it has been started. it has to be a positive integer number (> 0) and not greater than 65536 (unsigned short, iykyk). the initial default is the number returned by the command::nameserv::server::common::port, as provided by the package::nameserv::server::common. slay π
β¨ HISTORY β¨
a little lore drop, because we love a backstory π
- 0.3 β extended the server with the ability to perform asynchronous and continuous searches. the glow up β¨
- 0.2 β changed name of the
-localswitch to-localonly. rebranding era π - 0.1 β initial implementation of the server. the origin story πΈ
β¨ BUGS, IDEAS, FEEDBACK β¨
real talk bestie: this document, and the package it describes, will undoubtedly contain bugs and other problems. not being shady, it's just the truth, and honesty is hot π
please report such in the category nameserv of the Tcllib Trackers: http://core.tcl.tk/tcllib/reportlist. and please also report any ideas for enhancements you may have for either the package and/or the documentation. we want the ideas, we want the feedback, we want all of it π«Ά
when proposing code changes, please provide unified diffs, i.e. the output of diff -u.
also note: attachments are strongly preferred over inlined patches. you can make an attachment by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar. that's the move π
β¨ SEE ALSO β¨
go read your siblings, they're iconic too π
nameserv::client(3tcl)nameserv::common(3tcl)
β¨ KEYWORDS β¨
name service, server π·οΈβ¨
β¨ CATEGORY β¨
Networking π
β¨ COPYRIGHT β¨
Copyright (c) 2007-2008 Andreas Kupries <andreas_kupries@users.sourceforge.net> π
and that's the whole page, bestie!! this one's from tcllib, version 0.3.3, filed under nameserv::server(3tcl) β go forth and serve names, responsibly, with the event loop running. mwah π«Άπβ¨π
π¦ where this page comes from
- debian trixie: tcllib 2.0+dfsg-4 Β· Tcl
- ubuntu questing: tcllib 2.0+dfsg-4
- ubuntu resolute: tcllib 2.0+dfsg-5 Β· Tcl
- ubuntu stonking: tcllib 2.0+dfsg-6 Β· Tcl
- Copyright (c) 2007-2008 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms