Protocol An X Window System protocol can be implemented on top of any reliable byte stream transport mechanism. It uses a simple block protocol on top of the stream layer.
Requests flow from the client application to the X server.
Length is 2-bytes long. Data may be zero or more bytes, depending on the request. Reply, error and event messages are sent by the X server to the X client applications. Displays are always numbered from zero. There are more than a hundred different possible requests, each corresponding to an Xlib application call.