> Has anyone gotten jython to work with unix sockets, as python does? It
> doesn't seem to support this basic feature. :/
Java does not support unix-domain sockets because it is not a portable concept, e.g. it can't be supported on Windows, which doesn't have unix domain sokets. (Although it does have a related concept, named pipes, which uses a Windows-specific API, and different semantics).
> I would note there exist java-based packages (such as Junixsocket) to do
> this, I was expecting jython would support it for python compatibility.
We do our best to make jython compatible with cpython. But there are some cases where it is not possible, because the support simply is not there on the JVM. Another area where this is true is TIPC.
> Unfortunately the socket bits shipped in the Jython jar don't seem to
> allow for this.
In order to use junixsocket for jython sockets, junixsocket would have to be rewritten (both the C and java components of it) to support asynchronous/non-blocking IO. Unlike the rest of the jython socket implementation, junixsocket does not support asynchronous IO, meaning that it is not possible to use event driven programming with it.
The ease of event driven programming in python is one of the fundamental reasons why people choose the language as a platform for writing high-performance event driven servers such as twisted or tornado.
So, while it is possible to implement support for something like junixsocket in the jython socket module, it would only work on platforms where junixsocket works. Also it would quickly lead to complaints about it not supporting asynchronous IO, which would require a massive effort to fix. The existing jython IO layer is heavily dependent on java.nio APIs (which is part of the reason why jython IO is so performant).
> Why can't you use Junixsocket?
> Python (CPython) is extensible using extension or c-extension. To do the same
> thing with Java (Jython), you have to use Java Native Interface (JNI). Then you
> can use these Java API from Jython just like any Java API.
Directly using junixsocket from jython would be even easier than that, since the JNI bits are already implemented.
All that would be required is to A: Follow the junixsocket instructions on importing the JNI component, and B: import the library and coding against it's java API.