IT lexicon › Programming › xtrans

xtrans

Programming På svenska → Updated: 2026-10-10

The transport layer under X11 — the code that opens a Unix socket, TCP or something older on behalf of Xlib, the X server, the font server and ICE — and which nobody links against, because everybody compiles in their own copy.

The X protocol says nothing about how bytes travel, and in the 80s and 90s there were too many answers: TCP, Unix domain sockets, DECnet, SVR4 named pipes, TLI and STREAMS. Every program that spoke X carried its own variant of the code that picked the right one. X11R6 in 1994 gathered it into the X Transport Interface, xtrans, with one interface for opening, listening, accepting and closing connections regardless of what lies beneath. The DISPLAY string drives the choice: :0 becomes a Unix socket at /tmp/.X11-unix/X0, host:0 becomes TCP to port 6000, and the prefixes unix/, tcp/ and local/ can be given explicitly. Linux later gained the abstract socket @/tmp/.X11-unix/X0, which does not appear in the filesystem and so survives a cleaned-out /tmp.

The construction is odd. xtrans is not a shared library but a set of C files pulled in with #include by Xlib, the X server, xfs, ICE and XDM, each with its own name prefix via macros. That meant a bug in xtrans existed in five copies on the same system, but also that nobody needed an ABI-stable transport library in an era when nobody could agree on one. When distributions in the 2000s started launching the server with -nolisten tcp, it was xtrans's listener list they were poking at.

← Back to the lexicon