LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
LinkBack Search this Thread
Old 06-07-2010, 02:49 PM   #1
Martian Gnome
LQ Newbie
 
Registered: May 2010
Posts: 13

Rep: Reputation: 0
Question Client/Server Interaction Question


Hello,

I have been learning about how the client and server interact and I read that the X window system,
"uses a client/server model in which clients provide data and
services to servers, and servers supply display and interaction
capabilities to clients"
I am a little confused as to how a server can supply display capabilities to a client considering that the client is the machine who is communicating with the display device (eg. monitor, tv, etc.)

Could someone please enlighten me on this bit?
 
Old 06-07-2010, 03:50 PM   #2
lugoteehalt
Senior Member
 
Registered: Sep 2003
Location: UK
Distribution: Debian
Posts: 1,193
Blog Entries: 2

Rep: Reputation: 49
Quote:
Originally Posted by Martian Gnome View Post
I am a little confused as to how a server can supply display capabilities to a client considering that the client is the machine who is communicating with the display device (eg. monitor, tv, etc.)
Not an expert but it looks like you've overlooked that X is the other way round to normal server-client things.

The *server* is connected to the display. It has to run the display. So the local computer, if it's the one connected to the display, has the server on it, and typically a client as well - if it needs to use the display. And the remote computers just have X clients on them.

Incidentally a very downmarket computer indeed is often all that is necessary to be the server. Perhaps even an old 486.
 
Old 06-07-2010, 05:03 PM   #3
Martian Gnome
LQ Newbie
 
Registered: May 2010
Posts: 13

Original Poster
Rep: Reputation: 0
SO X-Clients don't have a display then?


Lets say you have two towers and one monitor and they are all connected.
One tower runs the server, and one the client.
Which of the two towers would be connected to the Monitor?
 
Old 06-07-2010, 05:43 PM   #4
jstephens84
Senior Member
 
Registered: Sep 2004
Distribution: (Home)Opensolaris, Ubuntu, CentOS, (Work - AIX, HP-UX, Red Hat)
Posts: 2,043

Rep: Reputation: 82
Quote:
Originally Posted by Martian Gnome View Post
SO X-Clients don't have a display then?


Lets say you have two towers and one monitor and they are all connected.
One tower runs the server, and one the client.
Which of the two towers would be connected to the Monitor?
X is actually a server that does displaying for the local host and for remote workstations. say like you want to get a display from a windows box, you could setup X to send remote screen and when you putty in you would get a desktop instead of the terminal.

As for which one of the two tower would be connected to the monitor it doesn't matter as both are running the X-server.
 
Old 06-07-2010, 06:30 PM   #5
Martian Gnome
LQ Newbie
 
Registered: May 2010
Posts: 13

Original Poster
Rep: Reputation: 0
So then every machine has both a server and a client with the server controlling how the GUI functions and the client just processing the data?
 
Old 06-07-2010, 06:37 PM   #6
lugoteehalt
Senior Member
 
Registered: Sep 2003
Location: UK
Distribution: Debian
Posts: 1,193
Blog Entries: 2

Rep: Reputation: 49
Quote:
Originally Posted by Martian Gnome View Post
SO X-Clients don't have a display then?


Lets say you have two towers and one monitor and they are all connected.
One tower runs the server, and one the client.
Which of the two towers would be connected to the Monitor?
Don't take my word I've forgotten most of this stuff.

Tower1 has the X server program on it. Tower2 has the X client on it as you say.

Tower1 has to be connected to the single monitor for X to work. You can only display anything in X on the monitor using tower2, tower1 cannot put anything on the monitor using X.

If it was needed to use tower1 to put stuff on the monitor using X tower1 would need the X client program installed as well as the X server.

In a single computer set up for example there will be the X client *and* the X server installed on the computer.

Last edited by lugoteehalt; 06-07-2010 at 06:38 PM.
 
Old 06-07-2010, 07:22 PM   #7
jschiwal
Moderator
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,263

Rep: Reputation: 562Reputation: 562Reputation: 562Reputation: 562Reputation: 562Reputation: 562
The server is at your terminal. The client is the program you are running. This program may be running on the same computer or on a remote host. At one time, before PCs, there would be a mini or main frame Unix computer that would run the applications. The users used X terminals. These terminals run the X server. In this classic setup, you would log into an x session (xdmcp login) on a remote computer and run the desktop environment on that remote machine.
The DISPLAY variable in a program's environment determines which terminal it is displayed on (and the mouse and keyboard input comes from). If you use "ssh -X" you can run programs on different remote computers and have them displayed on your local display (X terminal).

Suppose you have a computer that you use as a media server (called media for example). You can be at your laptop and start mplayer remotely and have it play on your plasma tv's input by entering:
ssh -X mplayer -fs -display :0.0 <videofile>
Without the -display :0.0, ssh would use :10.0 which is a proxy for your laptops display. In this default case, the media server wouldn't need to be running the Xorg server but the laptop would. The programs installed on the server would probably have Xorg libraries as dependencies. You may need it installed, but it doesn't need to be started if the display is remote to the server (e.g. your laptop).

The display used could even be located at a third computer. Most distro's make this more difficult today for security reasons. xauth cookies need to be passed to give access to the display. PAM's ssh configuration does this for you in the background. However in the last 6 months, using "ssh -X" isn't as easy when launching KDE and Gnome programs, because these programs may now use dbus for interprocess communications. I have added this to my ~/.bashrc file allow remote programs to work:
Code:
test -s ~/.alias && . ~/.alias || true
if [[ -n "$DISPLAY" ]] && [[ -n "$SSH_CLIENT" ]] && [[ -z "$DBUS_SESSION_BUS_ADDRESS" ]] ; then
        ## if not found, launch a new one
        eval $(dbus-launch --exit-with-session)
        export DBUS_SESSION_BUS_ADDRESS DBUS_SESSION_BUS_PID
On some distro's this may be done in the background for you by PAM. I'm using a 6 mo old distro with newer KDE backported programs, which may be why this is necessary for me.

Last edited by jschiwal; 06-07-2010 at 07:52 PM.
 
1 members found this post helpful.
Old 06-07-2010, 07:48 PM   #8
Martian Gnome
LQ Newbie
 
Registered: May 2010
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks Jschwial,

That really cleared up alot for me

Just one last thing, since the client is the program being ran, then the server would be running possibly hundreds of clients at a time(1 for an email app, another for web page app, another for a gaming app, etc.).

Is this correct?
 
Old 06-09-2010, 05:27 AM   #9
jschiwal
Moderator
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,263

Rep: Reputation: 562Reputation: 562Reputation: 562Reputation: 562Reputation: 562Reputation: 562
It may be better to say that the X server could be receiving messages from hundreds of clients at a time.
The messages are sent over the network, which will be localhost if the program and client are on the same machine.
 
1 members found this post helpful.
Old 06-09-2010, 09:58 PM   #10
Martian Gnome
LQ Newbie
 
Registered: May 2010
Posts: 13

Original Poster
Rep: Reputation: 0
Spectacular
 
  


Reply

Tags
xserver


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Any interaction with CUPS server takes over minute Doug Hutcheson Linux - Software 3 05-08-2010 03:35 AM
HOWTO install packages w/o interaction on ubuntu server? Skaperen Ubuntu 3 01-18-2010 10:06 AM
Linux Notes Client + Open Office = Nautilus interaction problem Aleksej Linux - Desktop 0 02-19-2007 10:18 AM
DHCP server and client lease question rickyinman Linux - Networking 0 04-14-2006 10:53 AM
client/server question (with sockets) bicycle Programming 1 11-24-2005 01:26 PM


All times are GMT -5. The time now is 12:22 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration