Originally Posted by hawhill
Errm, as far as Xorg is concerned, it only communicates via sockets, not depending on a certain type of them. While there is a convention/standard for transmission via TCP, communicating via Unix Domain Sockets instead is equally common (and *might* slightly reduce overhead). Unix Domain Sockets do not built on the IP layer (as TCP sockets do), thus are not IP addressed. They use filesystem namespace addressing instead (or non at all and do file descriptor sharing among processes). There's a convention to prefix the sockets with the "/tmp/X11-unix/" path. See socket(7), unix(7). Note that these sockets are not the same as FIFOs aka named pipes.
Without further configuration, Xorg handles both TCP and Unix Domain Sockets.
I recall reading that Unix Domain Sockets map onto TCP/IP sockets, and just added another layer of overhead to the stack. Because unix variants like to treat everything as a file (while Windows likes to treat everything as a window), linux adds a file interface onto a TCP/IP socket to provide simple file I/O access.
Unless I completely misunderstand how this works, a standard TCP/IP socket is created when a "/tmp/.X11-unix" file is opened. Or... is there a version without the "." in front of "X11" that acts differently?
Of course, newer kernels may have optimized the file interface better than the sockets interface. The only way to know for sure is to read the GPL source code provided by amazon.
Anyway, the *real* problem is that the Kindle framework appears to lock Xorg localhost port 0 exclusively so other apps cannot use it. Starting another Xorg listening on another port allows apps to use it.
It is a moot point anyway, because even without launching another Xorg instance, there is not much free memory left for native apps, especially if you use a loop mount so you can install packages that need symlinks.
Personally, my experience in all this was a long time ago when things were done differently. I do not know what X11 does down inside. I do know that what you would commonly think of as a client or server is reversed in X11, where the thing that shares the desktop is the client, and the thing you use to connect to it is a server. Did I get that right? It can be rather confusing.
The main point of this thread is that you CAN run native X apps without needing to install your own Xorg, which is what I found interesting. Regardless of what underlying interprocess communication method is used, another Xorg server instance appears to be needed to support native X apps (other than the framework) on the kindle, unless the startup scripts can be modified to allow apps to share display :0 (port 6000).
I wish I had more time to investigate this, but I have other demands on my time, and other things that interest me more than X apps right now, especially after discovering the excessive framework memory overhead inside the Kindle Touch.
I hope somebody can make use of this information. This is just thrown out there to show that it might be easy to port X apps to the Touch, because some small ones already work right out of the box.