Question regarding X windows client-server implementation
flowers at users.sourceforge.net
Wed Nov 10 21:08:05 PST 2004
On Wed, Nov 10, 2004 at 09:10:57PM -0700, Mark Jayson Alvarez wrote:
> But then I'm confused by the fact that I can let my
> x clients connect to a remote x server,(eg, on a LAN).
> How can that be?
> For example, I'm looking at my monitor right now..
> And then there is this xorg installed on another pc
> beside me. Now what I'm thinking is that the xorg
> installed on another pc, knows the specs of my monitor
> and graphics card and then I will authenticate my self
> to it remotely.. then what? the x server will manage
> my monitor and keyboard inputs remotely???
I'm no X expert, but this is how it seems to me:
A server is just a piece of code that does something when
another piece of code (a client) asks it to. So your X
server, which knows all about your hardware, sits there
waiting for the X client to ask it to do something. Like
"draw a square" or "print the letter 'X'" or "tell me
what key was just pressed". In the case of X the client
and server can be separated by a network, in which case
these requests and corresponding response data have to
travel down the wire. The nomenclature is a bit
confusing at first because we're used to thinking of the
client code being closest to the human and server code
as being farthest away (at least I am).
The keyboard, mouse, and video are not remote from the
X server; they're local to the X server. The X clients
execute on the remote box, but have their I/O sent
through a network connection to the X server. It's not
very different conceptually from connecting to a Unix
box using an SSH client from another machine. If I SSH
in to my home machine from work and run vi, vi is running
on my home box, but the output is displayed on my work
box and the input is collected from my work box. The
only difference is the shift in perspective needed to
mentally reverse the 'client' and 'server' roles.
More information about the freebsd-questions