RpcRegistry(3I)
β¨ RpcRegistry β the name space for finding RPC services β¨
okay bestie, welcome to the InterViews Reference Manual entry for RpcRegistry(3I) π this one's short and sweet and honestly kinda iconic, so let's get into it π«Ά
πΈ NAME πΈ
RpcRegistry β a whole name space for finding RPC services πβ¨
π SYNOPSIS π
#include <Dispatch/rpcregistry.h>
that's it. one include. no cap. π
π¦ DESCRIPTION π¦
so basically, RpcRegistry gives you a name space for finding RPC services, and the whole thing is built on the way NFS filesystems get shared among a group of hosts π like, that's the vibe it's leaning on, fr fr.
here's how it goes down π
- when an RPC service wants to record its host name and port number, it hands over the path of a file, and that's where the info gets stored π
- when a client wants to find that RPC service's host name and port number, it hands over the path of a file, and reads the info out of it π
and here's the lil detail that matters β usually that path is just the name of a file in the current working directory, because different hosts can have different absolute pathnames for the same file living in an NFS filesystem π€― so yeah, relative paths are the move.
the way that the RPC service's name space is the name space of the host's filesystem?? and the file's contents give you literally everything you need to open a connection to the RPC service?? obsessed. it's giving "the filesystem is the database" and honestly it ate π₯
π PUBLIC OPERATIONS π
first things first, every single one of these is a static member function, which means your program can just call it without ever having to instantiate an RpcRegistry object π§ no constructor, no drama, no object, just vibes.
and each function returns true if it succeeded, or false if some error occurred β periodt.
boolean record(const char* path, int port)β records the RPC service's host name and port number into the given file πΎ but bestie, listen: if the file already exists, its previous contents will be lost π so like, be aware. that's the whole warning. it does not care.boolean erase(const char* path)β removes the file that stores the RPC service's host name and port number, so that no more clients will be able to contact the RPC service ποΈβ¨ it's the goodbye button. the door is closed. the service is un-findable.boolean find(const char* path, char*& hostname, int& port)β opens the file that stores the RPC service's host name and port number π if the file does not exist, it returns failure silently (no yelling, no drama, just a quietfalseπ€«). if the file does exist, it reads the RPC service's host name and port address out of it π and here's the spicy part: ifhostnameis nil upon entry, then upon exit it will contain the address of a dynamically allocated string β which must be freed by the caller π«Ά don't forget, or that's a leak, and leaks are not slay.
lowkey the biggest glow-up here is find failing silently when the file isn't there β it's not a bug, it's a feature, it's just minding its own business π
π SEE ALSO π
RpcService(3I)β the other half of this duo, go read it next bestie π
and that's the whole page!! written under the InterViews banner, from the 27 March 1991 era β yeah she's vintage, she's retro, she's still serving π mwah, go record some services π¦β¨
π¦ where this page comes from
- debian bookworm: ivtools-dev 2.0.11d.a1-1+b4
- debian trixie: ivtools-dev 2.0.11d.a1-3+b4
- ubuntu jammy: ivtools-dev 2.0.11d.a1-1build1
- ubuntu noble: ivtools-dev 2.0.11d.a1-3build1
- ubuntu questing: ivtools-dev 2.0.11d.a1-3build7
- ubuntu resolute: ivtools-dev 2.0.11d.a1-3build9
- ubuntu stonking: ivtools-dev 2.1.1+git.2025.07.26.a1-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms