X protocal中谁是Client谁是Server?

X是Unix系统上最流行的视窗系统,类似与Windows和IBM的Presentation Manager。X protocal是80年代中期发展起来的网络透明的图形用户接口。

Windwos和Presentation Manager只能显示本地图形程序。X Protocal能够将图形显示这个过程在应用层分解成client-server关系。X client负责“what to do”,X server负责“how to do”。一般来说,X client运行在远程的具有很强计算能力的机器上,X server进行图形显示。这样做的好处是这正的client-server和分布式计算(?)
原文如下

The X Protocol was developed in the mid 1980’s amid the need to provide a network transparent graphical user interface primarily for the UNIX operating system. X provides for the display and management of graphical information, much in the same manner as Microsoft’s Windows and IBM’s Presentation Manager.

The key difference is in the structure of the X Protocol. Whereas Windows and Presentation Manager simply display graphical applications local to the PC, the X Protocol distributes the processing of applications by specifying a client-server relationship at the application level. The what to do part of the application is called an X client and is separated from the how to do part, the display, called the X server. X clients typically run on a remote machine which has excess computing power and displays on an X server. The benefit is true client-server and distributed processing.


以FreeBSD为例:

X 一开始就是针对网络而设计的,所以 采用了 “client-server” 模型。在 X 模型中, “X server” 运行在有键盘,显示器,鼠标的计算机上。 服务器用来管理显示信息,处理来自键盘和鼠标的输入等。 每一个 X 应用程序 (比如 XTerm, 或者 Netscape®) 就是一个 “client”。 一个 client 给服务器发送信息,如 “Please draw a window at these coordinates”, 然后服务器就返回处理信息,如 “The user just clicked on the OK button”。

如果您在只有一台计算机的家里或小型办公环境中使用 FreeBSD,您就 需要在同一台计算机上运行 X server和 X client。然而,如果您有很多运行 FreeBSD 的机器,您可以在您的桌面计算机上运行 X server,而在比较高档 的服务器上运行 X 应用程序。在这样的环境中,X server 和 X client 之间的 通信就可以通过网络来进行。

这迷惑了一些人,因为 X 的术语和他们料想的有些不同。 他们以为 “X server” 是运行在功能强大的大型机上的,而 “X client” 是运行在他们桌面上的计算机上的。

记住,X server 是有键盘和显示器的那台计算机,而 X client 是那些显示窗口的程序。

个人理解:X server是有显卡的那台计算机,显卡用来处理图形显示;X server是用来运行图形程序的远程主机。

例如:用desktop远程登陆test,制定X server为desktop,并运行test的firefox。那么firefox的图形就显示在desktop上,用desktop的鼠标键盘就可以使用这个firefox。这个firefox运行在远程test上,显示在本地desktop上,那么desktop就是X server,test就是X client:因为对于图形的请求都是test发送的,对于图形的实现都是desktop实现的。


并不需要 client 和 server 都运行在同一种操作系统上,或甚至运行在 同一种类型的计算机上。在 Microsoft Windows 或者 Apple 公司的 Mac OS 上运行 一个 X server 也是可以的,在它们上面也有很多免费的和商业化的应用程序。


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值