nameserv::protocol(3tcl)
π nameserv::protocol π
okay bestie, so this is a page from the Name service facility manual, and it's literally all about the client/server protocol for nameserv β you know, the vibes-level spec for how the client and the server talk to each other. Let's get into it. π¦
β¨ SYNOPSIS β¨
Bind name data
Release
Search pattern
ProtocolVersion
ProtocolFeatures
Search/Continuous/Start tag pattern
Search/Continuous/Stop tag
Search/Continuous/Change tag add|remove response
πΈ DESCRIPTION πΈ
So the packages nameserv::server, nameserv, and nameserv::common give you a simple β and, no cap, unprotected β name service facility. It's meant for small, trusted environments, bestie. Like, do not deploy this in a hostile network and expect it to fight for you. π
Please read Name service facility, introduction first. It's giving required reading. π
This document is the spec of the network protocol that the client and server use to talk to each other. The whole point is that it lets people implement the exact same protocol in other languages. Iconic, honestly. β¨
π NANO NAME SERVICE PROTOCOL VERSION 1 π
This protocol defines the basic set of messages that a name service has to support β also known as the Core feature.
π BASIC LAYER π
The basic communication between client and server runs over the remote-execution protocol specified by the Tcl package comm. The document that specs its on-the-wire protocol lives in comm_wire.
Every script swapped over this protocol is a single command in list form, which means you can just read them as plain messages instead of Tcl commands. The commands/messages listed in the next section are the only commands the server-side understands. And listen β command and variable substitutions are not allowed within the messages, so arguments have to be literal values. Periodt. π₯
The protocol is synchronous. Which means: for every message sent, a response is expected, and it has to be generated. All messages are sent by the client. The server does not send messages β it only sends responses to messages. That's the whole dynamic. π
π MESSAGE LAYER π
Bind name dataβ the client sends this when it registers itself with the service using a name and some associated data. If the name is already in use, the server has to send an error response. Otherwise the response has to be an empty string. Also, the server has to accept multiple names for the same client. She's flexible like that. πReleaseβ the client sends this to unregister all the names it's known under at the service. The response has to be an empty string, always. No exceptions, no drama. π«ΆSearch patternβ the client sends this to search the service for names matching the glob-pattern. The response has to be a dictionary with the matching names as keys, mapping them to the data associated with them atBind-time. πProtocolVersionβ the client sends this to ask the service for the highest version of the name service protocol it supports. The response has to be a positive integer number. Servers that only support Nano Name Service Protocol Version 1 have to return1. πProtocolFeaturesβ the client sends this to ask the service which features of the name service protocol it supports. The response has to be a list containing feature names. Servers supporting only Nano Name Service Protocol Version 1 have to return{Core}. β¨
π§ NANO NAME SERVICE PROTOCOL EXTENSION: CONTINUOUS SEARCH π§
This protocol defines an extended set of messages a name service has to support β also called the Search/Continuous feature. It adds extra messages between client and server, and is otherwise identical to version 1 of the protocol. See the last section for the details of our foundation. π
A service that supports this feature has to put the feature name Search/Continuous into the list of features returned by the message ProtocolFeatures. iykyk. π
For this extension the protocol is asynchronous. No direct response is expected for any of the messages in the extension. On top of that, the server will start sending messages on its own β instead of only responses to messages β and the client has to be able to handle those notifications. Main character server energy, fr fr. π
Search/Continuous/Start tag patternβ the client sends this to start searching the service for names matching the glob-pattern. In contrast to the regularSearchrequest, this one asks the server to continuously monitor the database for additions and removals of matching entries, and to notify the client of all such changes. The particular search is identified by the tag.
No direct response is expected β instead, the client expects to be notified of changes via explicit Search/Continuous/Result messages generated by the service.
It's also expected that the tag information is passed unchanged into the Search/Continuous/Result messages. This tagging of the results is what lets clients start multiple searches and tell the different results apart. So handy. π
Search/Continuous/Stop tagβ the client sends this to stop the continuous search identified by the tag. πSearch/Continuous/Change tag add|remove responseβ the service sends this message to clients with active continuous searches to transfer found changes. The first such message for a new continuous search has to contain the current set of matching entries.
To make sure that happens, a service has to generate an add-message with an empty response if there were no matching entries at the time. π
The response has to be a dictionary containing the matching names as keys, mapping them to the data associated with them at Bind-time. The argument that comes before the response tells the client whether the names in the response were added to or removed from the service. π
π BUGS, IDEAS, FEEDBACK π
This document β and the package it describes β will undoubtedly contain bugs and other problems. Like, obviously. Please report them in the category nameserv of the Tcllib Trackers: [http://core.tcl.tk/tcllib/reportlist]. And please also report any ideas for enhancements you have for either the package and/or the documentation. We love ideas. π«Ά
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 attach stuff by going to the Edit form of the ticket right after it's created, and then using the left-most button in the secondary navigation bar. Easy. β¨
π₯ SEE ALSO π₯
comm_wire(3tcl)nameserv(3tcl)nameserv::server(3tcl)
β KEYWORDS β
comm, name service, protocol
π 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.2, and it's the nameserv::protocol(3tcl) page β go forth and implement protocols, you absolute icon ππ
π¦ 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