Every newcomers to X think that servers and clients are reversed because they are

Peter Hutterer peter.hutterer at who-t.net
Tue Apr 19 21:11:47 PDT 2011


On Tue, Apr 19, 2011 at 11:36:17PM -0400, Paul Dufresne wrote:
> For years I have heard of how we must rethink what is the server and
> what are the clients when coming to X.
> 
> But the more I think about it, the more I conclude X is wrong, and
> should reverse their order.
> 
> What you call the X server should be an X client.
> You could think as the applications being the server... but I guess
> this is not really correct either.
> 
> An X server should wait for clients to connect (yes, that point X does
> the right thing).
> But what is now the client, should have a list of X server (that does
> not exist yet) to connect to.
> When you connect to an X server, you should be given a list of
> applications allowable to connect to. Then, you would be able to open
> one of the applications available, at your choice.
> 
> From there, a new connection would be open between the application and
> the client (what is now called the X server), pretty much like a new
> connection is created right now.
> 
> This would make X system much more useful I believe, because it would
> fit the way people expect server and clients to work. Then making a
> multi-user game would be pretty obvious, because it would just means
> to add some new avatar each time a new X client would connect to the
> game application on a given X server.
> 
> At least, that the way I think it should be.

sigh. I never understood why people claim that one must rethink
server/client when it comes to X. X server and client notion are _not_
reversed.

The X server sits there, waiting for connections. 
Just like FTP servers.

The X server provides auth mechanisms, restricting which clients can
connect.
Just like FTP servers.

Once a client connects, the server provides a specific protocol to
communicate. 
Just like FTP servers.

The protocol allows access to certain resources local to the machine. 
Just like FTP servers.
(in the FTP server's case the resources are files, in the X server's case
they are hardware resources)

The clients can upload data (e.g. pixel data) and download data (e.g. events
or state information).
Just like FTP servers.

When a client disconnects, the server continues to serve the other clients.
Just like FTP servers.

A client can connect to multiple servers, uploading data and downloading
data to all of them.
Just like FTP clients.

When the server shuts down, all clients are disconnected, but only from this
server. Connections to other servers stay open and active.
Just like FTP clients.

(I'm sure I could come up with more, but ...)

I repeat, X server and client notion are _not_ reversed. People seem get it
wrong because back in the days of yonder, there was a big machine that was
also referred to as "The server" and user's machines were referred to as
"the clients". And all the server processes like FTP, NFS, etc. were running
on "the server". All except X, where the user was running the server
software and "the server" was running the clients.

Hardware is not software, and this problem is little more than 
the English language using the same word for two different things.
You don't even have to rethink what servers and clients are. You just simply
ignore the hardware-specific definitions because quite frankly, they make
little sense these days anyway. My laptop runs several server processes yet
I would never think of it a server (in the hardware specific meaning).
I wouldn't consider my phone to be "the server" either, even though it
can run server software.

Cheers,
  Peter



More information about the xorg mailing list