ccorley / junixsocket

Unix Domain Sockets in Java (AF_UNIX)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

junixsocket

junixsocket is a Java/JNI library that allows the use of Unix Domain Sockets (AF_UNIX sockets) from Java.

Why it's cool

  • junixsocket is the most complete implementation of Unix Domain Sockets for the Java ecosystem.
  • Comes with pre-built native libraries for several operating systems and platforms, including macOS, Linux, Windows, Solaris, FreeBSD, NetBSD, OpenBSD, DragonFlyBSD.
  • Supports all Java versions since Java 7*.
  • Supports both the Java Socket API and NIO (java.net.Socket, java.net.SocketChannel, etc.)
  • Supports streams and datagrams.
  • Supports Remote Method Invocation (RMI) over AF_UNIX.
  • Supports JDBC database connectors (connect to a local database server via Unix sockets).
    • Generic AFUNIXSocketFactory for databases like PostgreSQL
    • Custom socket factory for MySQL Connector/J, as recommended by Oracle
  • Supports peer credentials.
  • Supports sending and receiving file descriptors.
  • Supports the abstract namespace on Linux.
  • Supports socketpair, and instantiating socket classes from file descriptors.
  • Supports HTTP over unix socket (using NanoHTTPD).
  • Supports JPMS/Jigsaw modules. Modularized so you can install only what you need.
  • Provides a selftest package with 100+ tests to ensure compatibility with any target platform.
  • Apache 2.0 licensed.

* (Tested up to Java 17; Java 7 support is limited to core functionality, no RMI).

Quick links

Licensing

junixsocket is released under the Apache 2.0 License.

Commercial support is available through KohlschĂĽtter Search Intelligence.

Self-test

To verify that the software works as expected on your platform, you can run the selftest program, which is located in the "junixsocket-dist" distribution package:

java -jar junixsocket-selftest-VERSION-jar-with-dependencies.jar 

(with VERSION being the corresponding junixsocket version).

Maven dependency

To include the core junixsocket functionality in your project, add the following Maven dependency

<dependency>
  <groupId>com.kohlschutter.junixsocket</groupId>
  <artifactId>junixsocket-core</artifactId>
  <version>2.4.1</version>
  <type>pom</type>
</dependency>

For more, optional packages (RMI, MySQL, server, etc.) see here

About

Unix Domain Sockets in Java (AF_UNIX)

License:Apache License 2.0


Languages

Language:Java 72.8%Language:C 15.6%Language:C++ 6.8%Language:Shell 4.7%Language:HTML 0.0%Language:CSS 0.0%