RpcService(3I)

πŸ’– RpcService(3I) πŸ’–

okay bestie, welcome to the InterViews Reference Manual page for RpcService β€” this is the one that lets a service and its clients talk RPC to each other. it's giving matchmaker but for processes. 🫢


✨ NAME ✨

RpcService β€” support RPC between a service and its clients


🌸 SYNOPSIS 🌸

#include <Dispatch/rpcservice.h>

πŸ¦‹ DESCRIPTION πŸ¦‹

So an RpcService (well, technically an instance of a derived class, because this bad boy is abstract, iykyk) creates a port and listens to it for connections from clients. iconic behaviour fr.

The moment a client opens a connection, the RpcService will create a reader to handle RPC requests coming in from that connection. it literally just handles it. no notes. πŸ’…


πŸŽ€ CONSTRUCTORS πŸŽ€

  • RpcService(int port)
  • RpcService(const char* path, int port = 0) β€” start up an RPC service. If a filename is given, it records the RPC service's hostname and port number in it so clients can contact the service. And if port is zero, the next free port number will be used. slay, automatic.

πŸ‘‘ PUBLIC OPERATIONS πŸ‘‘

  • void run()
  • void quitRunning() β€” read RPC requests continuously until quitRunning() terminates the loop. BUT here's the tea: if you're using InterViews, you don't have to call run(), because the InterViews event-reading code will also read RPC requests for you. free labour. we love that. 😭

🧚 PROTECTED OPERATIONS 🧚

  • virtual void createReader(int fd) = 0 β€” okay so this one is pure virtual, meaning you must define this function in a derived class in order to start servicing RPC requests from a new client. no cap, it's required. Typically all you have to do is construct a reader using the passed file descriptor, and make the reader responsible for deleting itself when it notices that the connection has been closed by the client. self-care king behaviour honestly. 🌈

πŸ’œ SEE ALSO πŸ’œ

  • Dispatcher(3I)
  • RpcReader(3I)
  • RpcRegistry(3I)

ngl that's the whole page bestie β€” no hidden options, no secret flags, just the port, the reader, and the vibe. πŸ“

mwah πŸ’‹ that was the InterViews manual page, dated 27 March 1991 β€” yes she's vintage, yes she still ate. πŸ’…βœ¨