What's the best way of using Unix domain sockets from Scala?
I've found a Java library called JUDS, but it doesn't appear to allow me to send file descriptors over the socket --- the reason I want to use Unix domain sockets in the first place.
The JUDS readme refers to a competing library called J-BUDS, but I cannot find this anywhere.
I could add the feature to JUDS myself, but I'd rather I'd rather not reinvent the wheel if it's already in a jar file elsewhere.
Unix sockets are a form of communication between two processes that appears as a file on disk. This file can be used by other programs to establish very fast connections between two or more processes without any network overhead.
They are to be stored in /run/ according to the Filesystem Hierarchy Standard (FHS).
UNIX domain sockets are named with UNIX paths. For example, a socket might be named /tmp/foo. UNIX domain sockets communicate only between processes on a single host.
http://download.oracle.com/javase/6/docs/api/java/net/Socket.html
By "file descriptors" do you mean objects of the class java.util.File? ...or C-style "FILE *"? (IIRC)
The latter would be tied to the particular instance of the OS, so I wouldn't think you would want to move that to (possibly) another machine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With