X11通道到底是什么

What exactly is X11 Channel

到目前为止我发现的所有 X11 文档中都写有这样的内容

Communication between server and clients is done by exchanging packets over a channel. The connection is established by the client (how the client is started is not specified in the protocol). (from wikipedia)

我没能找到这个频道到底是什么?例如网络渠道?是在港口吗?它是内存映射吗?感谢任何帮助。

'channel' 的措辞故意含糊不清,因为它可以通过本地套接字、远程连接(例如 SSH)、命名管道或其他允许 client/server 双向的方法沟通。也就是说,'channel'只是两点之间的连接,便于数据交换。

通过SSH进行X11转发时,通道为SSH连接。例如,参见 SSH man 页面:

$ man ssh

X11 connections and arbitrary TCP/IP ports can also be forwarded over the secure channel.

或根据 x.org 文档:

The communications channel between an X client and server is full-duplex: either side can send a message to the other at any time. This is canonically implemented over a TCP/IP socket interface, though other communications channels are often used, including Unix domain sockets, named pipes and shared memory. The channel must provide a reliable, ordered byte stream---the X protocol provides no mechanism for reordering or resending packets.

X11 支持多种形式的客户端和服务器之间的通信。这些所谓的通道可以是 TCP 套接字、UNIX 套接字和许多其他网络机制,例如 DECnet、令牌环等。TCP 和 UNIX 套接字实际上是当今唯一使用的套接字。

X 服务器是一个可以访问图形硬件、键盘和鼠标的进程。任何在计算机屏幕上生成图形的应用程序都称为客户端。通常,一个工作站上有 X server 运行ning 和多个 X 客户端。应用程序(客户端)需要通过 TCP 套接字(由 IP 地址和端口号标识)或 UNIX 套接字(由文件名标识,例如 /tmp/X0)

连接到 X-Server

如果服务器和客户端,运行 在同一个系统上,它们通常通过 UNIX 套接字连接。然而,X11 的一大特点是服务器和客户端不在同一系统上,而是通过 TCP 套接字通过网络连接。这使我们能够 运行 网络上不同计算机上的应用程序,并将它们的图形输出显示在一个屏幕上。 (单个应用程序也可以连接到多个 X 服务器并在多个屏幕上分发图形内容。)