I Serve No More
Right then it hit me. The basic server loop might be dead. I remember it from college quite well:
- bind()
- listen()
- accept()
- fork()
- back to accept()
A coworker was explaining how part of our system worked and it suddenly became clear that my traditional way of thinking about servers was dead. No longer was it necessary for a server to wait around, most of the time idle, for connections from users. No, instead we are now shifting, or perhaps have shifted, to on demand servers started by the client. Even better, secure on demand servers. What’s changed you ask? Now clients can connect to the server via ssh and start up a server process that merely reads and writes stdin and stdout (& stderr). This completely changes the game. The server program is greatly simplified, it no longer needs to know about sockets. A minor benefit is now you don’t have to add your server entry to inetd on your UNIX system so the system will manage incoming connections. Also, the server is running under the permissions of the account the client has access to (most likely the same account as the client program). An administrator on the server can just configure the settings of that account if they need to manage that user. No complicated authorization scheme as part of the server’s protocol–that’s taken care of for you by using ssh as your authenticating transport protocol.
Fascinating.
While the need to know sockets, TCP, IP, and UDP will always persist, there is a new powerful and simple option for writing and managing servers.

1 comment so far
Leave a reply
[...] It’s all very powerful and very much related to my previous post “I Serve No More”. [...]