### Install Build Dependencies Source: https://kohlschutter.github.io/junixsocket/graalvm.html Ensure necessary build tools like GCC and zlib development libraries are installed on your system. ```shell sudo apt-get install gcc zlib1g-dev ``` -------------------------------- ### Install Homebrew packages on macOS Source: https://kohlschutter.github.io/junixsocket/release.html Installs llvm and mingw-w64 using Homebrew. Ensure Homebrew is installed first. ```bash brew install llvm mingw-w64 ``` -------------------------------- ### Install junixsocket on target platform Source: https://kohlschutter.github.io/junixsocket/release.html Installs junixsocket on a target machine using Maven. Ensure the version matches the development machine's version. ```bash cd junixsocket mvn clean install -Dstrict ``` -------------------------------- ### SocketServer.onServerStarting Source: https://kohlschutter.github.io/junixsocket/apidocs/index-all.html Called when the server is starting up. ```APIDOC ## SocketServer.onServerStarting() ### Description Called when the server is starting up. ### Method Instance method ``` -------------------------------- ### Run Generic Server Demo with Options Source: https://kohlschutter.github.io/junixsocket/demo.html Launches a generic server demo, allowing custom Java options like specifying the demo type. ```bash ./run-demo.sh -- -Ddemo=(demo) org.newsclub.net.unix.demo.server.AFUNIXSocketServerDemo ``` -------------------------------- ### Run Simple Demo Client Source: https://kohlschutter.github.io/junixsocket/demo.html Example of how to run the SimpleTestClient demo using the run-demos.sh script. ```bash ./run-demo.sh org.newsclub.net.unix.demo.SimpleTestClient ``` -------------------------------- ### get() - SSLSupplier Source: https://kohlschutter.github.io/junixsocket/apidocs/index-all.html Gets a result from an SSLSupplier. ```APIDOC ## get() ### Description Gets a result. ### Method Method in interface org.newsclub.net.unix.ssl.SSLSupplier ``` -------------------------------- ### Run Simple Demo Server Source: https://kohlschutter.github.io/junixsocket/demo.html Example of how to run the SimpleTestServer demo using the run-demos.sh script. ```bash ./run-demo.sh org.newsclub.net.unix.demo.SimpleTestServer ``` -------------------------------- ### get() - AFIOSupplier Source: https://kohlschutter.github.io/junixsocket/apidocs/index-all.html Gets a result from an AFIOSupplier. ```APIDOC ## get() ### Description Gets a result. ### Method Method in interface org.newsclub.net.unix.AFIOSupplier ``` -------------------------------- ### get() - RemoteCloseableImpl Source: https://kohlschutter.github.io/junixsocket/apidocs/index-all.html Implementation of the get() method for RemoteCloseable. ```APIDOC ## get() ### Description Implementation of the get() method. ### Method Method in class org.newsclub.net.unix.rmi.RemoteCloseableImpl ``` -------------------------------- ### Run Generic Client Demo with Options Source: https://kohlschutter.github.io/junixsocket/demo.html Launches a generic client demo, allowing custom Java options like specifying the demo type and the socket to connect to. ```bash ./run-demo.sh -- -Ddemo=(demo) -Dsocket=(socket) org.newsclub.net.unix.demo.client.DemoClient ``` -------------------------------- ### Run Simple RMI Client Demo Source: https://kohlschutter.github.io/junixsocket/demo.html Example of how to run the SimpleRMIClient demo using the run-demos.sh script. ```bash ./run-demo.sh org.newsclub.net.unix.demo.rmi.SimpleRMIClient ``` -------------------------------- ### Install LLVM on macOS Source: https://kohlschutter.github.io/junixsocket/crosscomp.html On Mac, the Xcode version of clang is insufficient. Install LLVM from Homebrew. ```bash brew install llvm ``` -------------------------------- ### Run Simple RMI Server Demo Source: https://kohlschutter.github.io/junixsocket/demo.html Example of how to run the SimpleRMIServer demo using the run-demos.sh script. ```bash ./run-demo.sh org.newsclub.net.unix.demo.rmi.SimpleRMIServer ``` -------------------------------- ### Start Virtual Thread Source: https://kohlschutter.github.io/junixsocket/junixsocket-codecoverage/jacoco-aggregate/junixsocket-common/org.newsclub.net.unix/ThreadUtil.java.html Starts a new virtual thread to execute a given Runnable. This is used when virtual threads are preferred. ```java return Thread.ofVirtual().start(run); ``` -------------------------------- ### Java RMI Client Example Source: https://kohlschutter.github.io/junixsocket/cpd.html Demonstrates a simple RMI client connecting to a registry and looking up a HelloWorld service. Requires AFUNIXNaming to be set up. ```java public final class SimpleRMIClient { public static void main(String[] args) throws IOException, NotBoundException { AFUNIXNaming naming = AFUNIXNaming.getInstance(); System.out.println("Locating registry..."); final Registry registry = naming.getRegistry(); System.out.println(registry); System.out.println(); HelloWorld obj = (HelloWorld) registry.lookup("helloWorld"); System.out.println("HelloWorld instance:"); System.out.println(" " + obj); System.out.println(" " + RemotePeerInfo.remotePeerCredentials(obj)); System.out.println(); ``` -------------------------------- ### main Source: https://kohlschutter.github.io/junixsocket/apidocs/org.newsclub.net.unix.demo.jpackagejlink/org/newsclub/net/unix/demo/jpackagejlink/DemoMainClass.html The entrypoint method for the jpackage or jlink demo binary. This method is invoked when the demo application is run. ```APIDOC ## main ### Description The entrypoint method for the jpackage or jlink demo binary. ### Method Signature `public static void main(String[] args)` ### Parameters #### Parameters - `args` (String[]) - The program arguments. ``` -------------------------------- ### Get RMI Service with Specific Registry Source: https://kohlschutter.github.io/junixsocket/junixsocket-codecoverage/jacoco-aggregate/junixsocket-rmi/org.newsclub.net.unix.rmi/AFNaming.java.html Gets the RMI service from a provided AFRegistry instance. If the service has not been initialized, it fetches it from the registry. ```java synchronized AFRMIService getRMIService(AFRegistry reg) throws RemoteException, NotBoundException { if (rmiService == null) { this.rmiService = getRMIServiceFromRegistry(reg); } return rmiService; } ``` -------------------------------- ### Run HTTP Server Demo with JAR Source: https://kohlschutter.github.io/junixsocket/demo.html Launches the HTTP server demo, requiring the nanohttpd JAR to be specified using the -j flag. ```bash ./run-demo.sh -j (path-to-nanohttpd-jar) -- org.newsclub.net.unix.demo.nanohttpd.NanoHttpdServerDemo ``` -------------------------------- ### Get Singleton Instance of AFGenericSelectorProvider Source: https://kohlschutter.github.io/junixsocket/junixsocket-common/jacoco/org.newsclub.net.unix/AFGenericSelectorProvider.java.html Provides access to the singleton instance of AFGenericSelectorProvider. This is the standard way to get the provider for junixsocket's generic address family. ```java @SuppressFBWarnings("MS_EXPOSE_REP") public static AFGenericSelectorProvider getInstance() { return INSTANCE; } ``` ```java public static AFGenericSelectorProvider provider() { return getInstance(); } ``` -------------------------------- ### HelloWorld Source: https://kohlschutter.github.io/junixsocket/apidocs/allclasses-index.html A very simple "hello world" service. ```APIDOC ## HelloWorld ### Description A very simple "hello world" service. ### Class HelloWorld ``` -------------------------------- ### Get and Set Time To Live in AFDatagramSocketImpl Source: https://kohlschutter.github.io/junixsocket/junixsocket-codecoverage/jacoco-aggregate/junixsocket-common/org.newsclub.net.unix/AFDatagramSocketImpl.java.html Implements methods to get and set the Time To Live (TTL) for datagram packets. The setTimeToLive method is currently ignored. ```java @Override protected final int getTimeToLive() throws IOException { return 0; } ``` ```java @Override protected final void setTimeToLive(int ttl) throws IOException { // ignored } ``` -------------------------------- ### newInstance Method Source: https://kohlschutter.github.io/junixsocket/apidocs/org.newsclub.net.unix.rmi/org/newsclub/net/unix/rmi/AFNamingProvider.html Creates a new AFNaming instance using the specified registry port. ```APIDOC ## Method: newInstance ### Signature `T newInstance(int registryPort) throws IOException` ### Description Creates a new `AFNaming` instance using the given registry port. ### Parameters * `registryPort` (int) - The registry port. ### Returns * `T` - The `AFNaming` instance. ### Throws * `IOException` - on error. ``` -------------------------------- ### Start Platform Daemon Thread Source: https://kohlschutter.github.io/junixsocket/junixsocket-codecoverage/jacoco-aggregate/junixsocket-common/org.newsclub.net.unix/ThreadUtil.java.html Starts a new platform daemon thread to execute a given Runnable. This is used as a fallback when virtual threads are not the primary choice. ```java return Thread.ofPlatform().daemon(true).start(run); ``` -------------------------------- ### newInstance Source: https://kohlschutter.github.io/junixsocket/junixsocket-darwin/apidocs/org.newsclub.net.unix.darwin/org/newsclub/net/unix/darwin/system/AFSYSTEMSocket.html Creates a new, unbound AFSYSTEMSocket. ```APIDOC ## newInstance ### Description Creates a new, unbound `AFSocket`. ### Method Signature `static AFSYSTEMSocket newInstance()` ``` -------------------------------- ### Run Demo with Module Path (Java 9+) Source: https://kohlschutter.github.io/junixsocket/demo.html Demonstrates using the -m flag to specify the Java module path instead of the classpath for Java 9 and higher. ```bash ./run-demo.sh -m ... ``` -------------------------------- ### Build and test junixsocket Source: https://kohlschutter.github.io/junixsocket/building.html Performs a clean build and installation of junixsocket using Maven. The second command shows how to disable the retrolambda plugin if JDK 8 is not installed. ```bash cd junixsocket mvn clean install ``` ```bash # or: # mvn clean install -Dretrolambda=false ``` -------------------------------- ### Get junixsocket Version Source: https://kohlschutter.github.io/junixsocket/junixsocket-codecoverage/jacoco-aggregate/junixsocket-common/org.newsclub.net.unix/AFSocket.java.html Retrieves the version of the junixsocket library. It attempts to get the version from build properties first, then from the native library. Returns null if the version cannot be determined. ```java public static final String getVersion() { String v = BuildProperties.getBuildProperties().get("git.build.version"); if (v != null && !v.startsWith("$")) { return v; } try { return NativeLibraryLoader.getJunixsocketVersion(); } catch (IOException e) { return null; } } ``` -------------------------------- ### HelloWorld.hello() Source: https://kohlschutter.github.io/junixsocket/apidocs/index-all.html Returns "Hello". ```APIDOC ## HelloWorld.hello() ### Description Returns "Hello". ### Method N/A (Method signature) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ``` -------------------------------- ### engineInit Source: https://kohlschutter.github.io/junixsocket/junixsocket-codecoverage/jacoco-aggregate/junixsocket-ssl/org.newsclub.net.unix.ssl/BuilderSSLContext.java.html Initializes the SSLContext with the provided KeyManagers, TrustManagers, and a SecureRandom instance. ```APIDOC ## engineInit(KeyManager[] km, TrustManager[] tm, SecureRandom sr) ### Description Initializes the SSLContext with the provided KeyManagers, TrustManagers, and a SecureRandom instance. ### Method Signature `protected void engineInit(KeyManager[] km, TrustManager[] tm, SecureRandom sr) throws KeyManagementException` ### Parameters - **km** (KeyManager[]) - An array of KeyManager objects to use for authentication. - **tm** (TrustManager[]) - An array of TrustManager objects to use for verifying certificates. - **sr** (SecureRandom) - A SecureRandom instance to use for random number generation. ### Throws - **KeyManagementException** - If the KeyManager or TrustManager initialisation fails. ``` -------------------------------- ### Java ParseException Example Source: https://kohlschutter.github.io/junixsocket/junixsocket-common/pmd.html This is an example of a ParseException that occurs when module declarations (Java 9+) are used with an older language version. It indicates an issue with parsing the module-info.java file. ```java net.sourceforge.pmd.lang.ParseException: Parse exception in file '/Users/ck/Entwicklung/workspace/junixsocket/junixsocket-common/src/main/java/module-info.java' at line 5, column 1: Module declarations are a feature of Java 9, you should select your language version accordingly at net.sourceforge.pmd.lang.java.ast.internal.ReportingStrategy$1.report(ReportingStrategy.java:55) at net.sourceforge.pmd.lang.java.ast.internal.ReportingStrategy$1.report(ReportingStrategy.java:42) at net.sourceforge.pmd.lang.java.ast.internal.LanguageLevelChecker.check(LanguageLevelChecker.java:100) at net.sourceforge.pmd.lang.java.ast.internal.LanguageLevelChecker.access$300(LanguageLevelChecker.java:67) at net.sourceforge.pmd.lang.java.ast.internal.LanguageLevelChecker$CheckVisitor.visit(LanguageLevelChecker.java:643) at net.sourceforge.pmd.lang.java.ast.internal.LanguageLevelChecker$CheckVisitor.visit(LanguageLevelChecker.java:411) at net.sourceforge.pmd.lang.java.ast.ASTModuleDeclaration.acceptVisitor(ASTModuleDeclaration.java:32) at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.acceptVisitor(AbstractJavaNode.java:38) at net.sourceforge.pmd.lang.java.ast.internal.LanguageLevelChecker.lambda$check$0(LanguageLevelChecker.java:93) at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133) at net.sourceforge.pmd.lang.ast.internal.IteratorBasedNStream.forEach(IteratorBasedNStream.java:102) at net.sourceforge.pmd.lang.java.ast.internal.LanguageLevelChecker.check(LanguageLevelChecker.java:93) at net.sourceforge.pmd.lang.java.ast.JavaParser.parseImpl(JavaParser.java:66) at net.sourceforge.pmd.lang.java.ast.JavaParser.parseImpl(JavaParser.java:25) at net.sourceforge.pmd.lang.ast.impl.javacc.JjtreeParserAdapter.parse(JjtreeParserAdapter.java:36) at net.sourceforge.pmd.lang.impl.PmdRunnable.parse(PmdRunnable.java:112) at net.sourceforge.pmd.lang.impl.PmdRunnable.processSource(PmdRunnable.java:132) at net.sourceforge.pmd.lang.impl.PmdRunnable.run(PmdRunnable.java:80) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.lang.Thread.run(Thread.java:1570) ``` -------------------------------- ### Install Custom Xcode SDK with crossclang Source: https://kohlschutter.github.io/junixsocket/xcode.html Run this script in the Terminal to set up a custom Xcode SDK for cross-compiling junixsocket native code. Ensure you restart Xcode after installation. ```shell ./junixsocket-native/crossclang/Xcode-Support/install ``` -------------------------------- ### withKeyStore (File) Source: https://kohlschutter.github.io/junixsocket/junixsocket-codecoverage/jacoco-aggregate/junixsocket-ssl/org.newsclub.net.unix.ssl/SSLContextBuilder.java.html Configures the builder to use a keystore specified by a file path and password. ```APIDOC ## withKeyStore (File) ### Description Configures this builder to use the given keystore, identified by path and password. ### Method `withKeyStore(File path, SSLSupplier password)` ### Parameters * **path** (File) - The path to the keystore. * **password** (SSLSupplier) - The supplier that returns the password to unlock the keystore. ### Throws * FileNotFoundException * MalformedURLException * IllegalStateException ``` -------------------------------- ### newInstance() Source: https://kohlschutter.github.io/junixsocket/apidocs/org.newsclub.net.unix/org/newsclub/net/unix/AFUNIXServerSocket.html Returns a new, unbound AF_UNIX ServerSocket. ```APIDOC ## newInstance() ### Description Returns a new, unbound AF_UNIX `ServerSocket`. ### Returns The new, unbound `AFServerSocket`. ### Throws `IOException` - if the operation fails. ``` -------------------------------- ### Install native library to Maven repository Source: https://kohlschutter.github.io/junixsocket/release.html Installs the nar files into the local Maven repository cache. This command should be run on the development computer after copying nar files from the target machine. ```bash cd junixsocket junixsocket-native-prebuilt/bin/install-to-m2repo.sh junixsocket-native-prebuilt/nar/*nar ``` -------------------------------- ### Install specific mingw-w64 version on macOS Source: https://kohlschutter.github.io/junixsocket/release.html Removes the current mingw-w64, installs version 11.0 from a specific commit, and pins it to prevent automatic updates. This is a workaround for incompatibilities with mingw 12.0. ```bash brew remove mingw-w64 wget https://raw.githubusercontent.com/Homebrew/homebrew-core/0247512f8a852f36f14b11809ac08a402de1f9e5/Formula/m/mingw-w64.rb brew install ./mingw-w64.rb brew pin mingw-w64 ``` -------------------------------- ### engineCreateSSLEngine Source: https://kohlschutter.github.io/junixsocket/junixsocket-codecoverage/jacoco-aggregate/junixsocket-ssl/org.newsclub.net.unix.ssl/BuilderSSLContext.java.html Creates and returns an SSLEngine initialized with the context's parameters. ```APIDOC ## engineCreateSSLEngine() ### Description Creates and returns an SSLEngine initialized with the context's parameters, suitable for the current client/server mode. ### Method Signature `protected SSLEngine engineCreateSSLEngine()` ### Returns - **SSLEngine** - An initialized SSLEngine. ``` -------------------------------- ### Build Maven Site Source: https://kohlschutter.github.io/junixsocket/release.html Navigate to the junixsocket directory and execute the build-site script. The website will be generated in junixsocket/target/staging/index.html. ```bash cd junixsocket ./scripts/build-site ``` -------------------------------- ### Install build dependencies on Alpine Linux Source: https://kohlschutter.github.io/junixsocket/building.html Installs essential packages for building junixsocket on Alpine Linux, including git, Maven, clang, gcc, binutils, and C development headers. ```bash sudo apk add git maven clang gcc binutils bash musl-dev libc-dev linux-headers ``` -------------------------------- ### get() Source: https://kohlschutter.github.io/junixsocket/junixsocket-common/apidocs/index-all.html Retrieves a result from an AFIOSupplier. ```APIDOC ## get() ### Description Gets a result. ### Method N/A (Method signature) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ### Response Example N/A ``` -------------------------------- ### Prepare Next Version (Maven) Source: https://kohlschutter.github.io/junixsocket/release.html Update the project version to a SNAPSHOT release and then clean and install the project. Replace X.Y.Z with the actual version number. ```bash mvn versions:set -DnewVersion=X.Y.Z-SNAPSHOT mvn clean install ``` -------------------------------- ### AFSYSTEMSocket.newInstance Source: https://kohlschutter.github.io/junixsocket/apidocs/org.newsclub.net.unix.darwin/org/newsclub/net/unix/darwin/system/AFSYSTEMSocket.html Creates a new, unbound AFSYSTEMSocket. ```APIDOC ## newInstance() ### Description Creates a new, unbound `AFSocket`. ### Method `static AFSYSTEMSocket` ### Returns A new, unbound `AFSYSTEMSocket`. ``` -------------------------------- ### getFileDescriptor Source: https://kohlschutter.github.io/junixsocket/junixsocket-codecoverage/jacoco-aggregate/junixsocket-common/org.newsclub.net.unix/AFServerSocket.java.html Gets the underlying FileDescriptor for this socket. ```APIDOC ## getFileDescriptor ### Description Returns the file descriptor associated with this socket. ### Returns - The {@link FileDescriptor} of the socket. ### Throws - {@link IOException} if an I/O error occurs. ``` -------------------------------- ### initServerImpl Source: https://kohlschutter.github.io/junixsocket/junixsocket-codecoverage/jacoco-aggregate/junixsocket-common/org.newsclub.net.unix/NativeUnixSocket.java.html Initializes the server implementation for a Unix domain socket. ```APIDOC ## initServerImpl ### Description Initializes the server implementation for a Unix domain socket. ### Method `static native void initServerImpl(ServerSocket serverSocket, AFSocketImpl impl) throws IOException` ### Parameters * **serverSocket** (ServerSocket) - The server socket to initialize. * **impl** (AFSocketImpl) - The socket implementation details. ### Throws * IOException - Upon error. ``` -------------------------------- ### getRemoteAddress Source: https://kohlschutter.github.io/junixsocket/junixsocket-codecoverage/jacoco-aggregate/junixsocket-common/org.newsclub.net.unix/AFSocketChannel.java.html Gets the remote socket address. ```APIDOC ## getRemoteAddress ### Description Gets the remote socket address to which this channel is connected. ### Method Signature ```java public final A getRemoteAddress() throws IOException ``` ### Returns * (`A`): The remote socket address. ### Throws * `IOException`: If an I/O error occurs while retrieving the address. ``` -------------------------------- ### engineCreateSSLEngine Source: https://kohlschutter.github.io/junixsocket/junixsocket-codecoverage/jacoco-aggregate/junixsocket-ssl/org.newsclub.net.unix.ssl/BuilderSSLContext.java.html Creates and returns an SSLEngine for a specific host and port, initialized with the context's parameters. ```APIDOC ## engineCreateSSLEngine(String host, int port) ### Description Creates and returns an SSLEngine for a specific host and port, initialized with the context's parameters. ### Method Signature `protected SSLEngine engineCreateSSLEngine(String host, int port)` ### Parameters - **host** (String) - The hostname to connect to. - **port** (int) - The port number to connect to. ### Returns - **SSLEngine** - An initialized SSLEngine for the specified host and port. ``` -------------------------------- ### newInstance with Address Source: https://kohlschutter.github.io/junixsocket/junixsocket-darwin/xref/org/newsclub/net/unix/darwin/system/AFSYSTEMSocket.html Creates a new AFSYSTEMSocket and connects it to the specified AFSYSTEMSocketAddress. ```APIDOC ## newInstance ### Description Creates a new {@link AFSocket} and connects it to the given {@link AFSYSTEMSocketAddress}. ### Parameters * `addr` (AFSYSTEMSocketAddress) - The address to connect to. ### Returns A new, connected socket. ### Throws * `IOException` if the operation fails. ``` -------------------------------- ### RemotePeerInfo.getHost Source: https://kohlschutter.github.io/junixsocket/apidocs/org.newsclub.net.unix.rmi/org/newsclub/net/unix/rmi/RemotePeerInfo.html Gets the hostname of the remote peer. ```APIDOC ## getHost ### Description The hostname. ### Method `String` ### Returns - `String` - The hostname ``` -------------------------------- ### get() Method Source: https://kohlschutter.github.io/junixsocket/apidocs/org.newsclub.net.unix.rmi/org/newsclub/net/unix/rmi/RemoteCloseableImpl.html Retrieves the wrapped resource. ```APIDOC ## get() ### Description Returns the resource (or the Remote instance of it). If the returned resource is `Closeable`, then closing via `get().close()` will affect the client-side (local), but not necessarily the server-side as well (the exact behavior depends on the resource). ### Method T ### Returns - **T** - The wrapped resource. ### Throws - **IOException** - if there was a problem retrieving the resource. ``` -------------------------------- ### Instance Methods Source: https://kohlschutter.github.io/junixsocket/junixsocket-common/apidocs/org.newsclub.net.unix/org/newsclub/net/unix/AFSYSTEMSocketAddress.html Methods for accessing information about an existing AFSYSTEMSocketAddress. ```APIDOC ## Instance Methods ### `File getFile()` Returns the `File` corresponding with this address, if possible. ### `int getId()` Returns the "id" part of the address. ### `@NonNull AFSYSTEMSocketAddress.SysAddr getSysAddr()` Returns the "SysAddr" part of the address. ### `int getUnit()` Returns the "unit" part of the address. ### `boolean hasFilename()` Checks if the address can be resolved to a `File`. ### `String toString()` Returns a string representation of the socket address. ### `URI toURI(String scheme, URI template)` Tries to create a URI based on this `AFSocketAddress`. ``` -------------------------------- ### getTimeToLive() Source: https://kohlschutter.github.io/junixsocket/apidocs/org.newsclub.net.unix/org/newsclub/net/unix/AFDatagramSocketImpl.html Gets the time-to-live for multicast datagrams. ```APIDOC ## getTimeToLive() ### Description Gets the time-to-live for multicast datagrams. ### Returns The time-to-live value. ### Throws * `IOException` ``` -------------------------------- ### newInstance Source: https://kohlschutter.github.io/junixsocket/junixsocket-tipc/apidocs/org.newsclub.net.unix.tipc/org/newsclub/net/unix/tipc/AFTIPCSocket.html Creates a new, unbound AFTIPCSocket. ```APIDOC ## newInstance ### Description Creates a new, unbound `AFSocket`. ### Method Signature `static AFTIPCSocket newInstance()` ``` -------------------------------- ### main(String[] args) Source: https://kohlschutter.github.io/junixsocket/junixsocket-vsock/xref/org/newsclub/net/unix/vsock/AFVSOCKSocket.html A basic self-test function that prints the support status of AFVSOCKSocket to System.out. ```APIDOC ## main(String[] args) ### Description Very basic self-test function. Prints "supported" and "capabilities" status to System.out. ### Method `public static void main(String[] args)` ### Parameters #### Path Parameters - **args** (String[]) - ignored. ### Notes If you want to run this directly from within Eclipse, see org.newsclub.net.unix.vsock.SocketTest#testMain. ``` -------------------------------- ### getTTL() Source: https://kohlschutter.github.io/junixsocket/apidocs/org.newsclub.net.unix/org/newsclub/net/unix/AFDatagramSocketImpl.html Gets the time-to-live for multicast datagrams. ```APIDOC ## getTTL() ### Description Gets the time-to-live for multicast datagrams. ### Returns The time-to-live value. ### Throws * `IOException` ### Deprecated This method is deprecated. ``` -------------------------------- ### startNewDaemonThread Source: https://kohlschutter.github.io/junixsocket/apidocs/org.newsclub.net.unix/org/newsclub/net/unix/ThreadUtil.html Starts a new daemon thread. ```APIDOC ## startNewDaemonThread ### Description Starts a new daemon thread. ### Method `public static Thread startNewDaemonThread(boolean virtual, Runnable run)` ### Parameters #### Path Parameters - **virtual** (boolean) - Required - If `true`, try to start a virtual Thread instead of a platform Thread (or at least pretend it's a virtual thread if they're not supported natively); if `false`, a "daemon" platform thread is started. - **run** (Runnable) - Required - The runnable. ### Returns - The thread. ``` -------------------------------- ### Get Architecture and OS List in Java Source: https://kohlschutter.github.io/junixsocket/junixsocket-common/jacoco/org.newsclub.net.unix/NativeLibraryLoader.java.html Returns a list of strings representing potential architecture and OS combinations for library loading. ```java static List getArchitectureAndOS() { return ARCHITECTURE_AND_OS; } ``` -------------------------------- ### Get Group Scope Source: https://kohlschutter.github.io/junixsocket/junixsocket-tipc/jacoco/org.newsclub.net.unix.tipc/AFTIPCGroupRequest.java.html Returns the group scope. ```java public Scope getScope() { return scope; } ``` -------------------------------- ### AFNaming Methods Source: https://kohlschutter.github.io/junixsocket/junixsocket-rmi/apidocs/index-all.html Methods for initializing prerequisites, managing socket factories, checking remote shutdown capabilities, listing registry contents, looking up remote objects, and creating new AFRegistry instances. ```APIDOC ## initRegistryPrerequisites() ### Description Called by `AFNaming.createRegistry()` right before creating/setting the registry. ### Method Method ### Class org.newsclub.net.unix.rmi.AFNaming ``` ```APIDOC ## initSocketFactory() ### Description Creates or returns the `AFRMISocketFactory` to be used with this instance. ### Method Method ### Class org.newsclub.net.unix.rmi.AFNaming ``` ```APIDOC ## isRemoteShutdownAllowed() ### Description Checks if this `AFNaming` instance can be shut down remotely. ### Method Method ### Class org.newsclub.net.unix.rmi.AFNaming ``` ```APIDOC ## list() ### Description Convenience method for `getRegistry().list`. ### Method Method ### Class org.newsclub.net.unix.rmi.AFNaming ``` ```APIDOC ## lookup(String) ### Description Convenience method for `getRegistry().lookup`. ### Method Method ### Class org.newsclub.net.unix.rmi.AFNaming ``` ```APIDOC ## lookup(String, long, TimeUnit) ### Description Convenience method for `getRegistry().lookup`. ### Method Method ### Class org.newsclub.net.unix.rmi.AFNaming ``` ```APIDOC ## newAFRegistry(Registry) ### Description Creates a new `AFRegistry` given a `Registry` implementation. ### Method Method ### Class org.newsclub.net.unix.rmi.AFNaming ``` ```APIDOC ## openRegistry(long, TimeUnit) ### Description Tries to access the registry, waiting some time if necessary. ### Method Method ### Class org.newsclub.net.unix.rmi.AFNaming ``` -------------------------------- ### Get Group Instance Source: https://kohlschutter.github.io/junixsocket/junixsocket-tipc/jacoco/org.newsclub.net.unix.tipc/AFTIPCGroupRequest.java.html Returns the group instance. ```java public int getInstance() { return instance; } ``` -------------------------------- ### Get Group Type Source: https://kohlschutter.github.io/junixsocket/junixsocket-tipc/jacoco/org.newsclub.net.unix.tipc/AFTIPCGroupRequest.java.html Returns the group type. ```java public int getType() { return type; } ``` -------------------------------- ### SSLContextBuilder Helper Static Methods Source: https://kohlschutter.github.io/junixsocket/apidocs/org.newsclub.net.unix.ssl/org/newsclub/net/unix/ssl/SSLContextBuilder.html Helper static method for creating new KeyStore instances. ```APIDOC ## Helper Static Methods ### `static KeyStore newKeyStorePKCS12()` Returns a new `PKCS12` `KeyStoreException` instance. ``` -------------------------------- ### AFUNIXNaming getInstance(File socketDir, int registryPort, String socketPrefix, String socketSuffix) Source: https://kohlschutter.github.io/junixsocket/apidocs/org.newsclub.net.unix.rmi/org/newsclub/net/unix/rmi/class-use/AFUNIXNaming.html Creates an AFUNIXNaming instance with custom directory, port, and socket file naming conventions. ```APIDOC ## AFUNIXNaming getInstance(File socketDir, int registryPort, String socketPrefix, String socketSuffix) ### Description Returns a `AFUNIXNaming` instance which support several socket files that can be stored under the same, given directory. ### Method `static AFUNIXNaming` ### Parameters #### Path Parameters - **socketDir** (File) - Required - The directory where socket files will be stored. - **registryPort** (int) - Required - The port for the RMI registry. - **socketPrefix** (String) - Required - The prefix for socket file names. - **socketSuffix** (String) - Required - The suffix for socket file names. ``` -------------------------------- ### get() Method Source: https://kohlschutter.github.io/junixsocket/junixsocket-rmi/apidocs/org.newsclub.net.unix.rmi/org/newsclub/net/unix/rmi/RemoteCloseableImpl.html Retrieves the wrapped remote resource. ```APIDOC ## get() ### Description Returns the resource (or the Remote instance of it). If the returned resource is `Closeable`, then closing via `get().close()` will affect the client-side (local), but not necessarily the server-side as well (the exact behavior depends on the resource). ### Method `T get()` ### Returns - **T** - The wrapped resource. ### Throws - **IOException** - If there was a problem retrieving the resource. ``` -------------------------------- ### Create New PKCS12 KeyStore Instance Source: https://kohlschutter.github.io/junixsocket/junixsocket-codecoverage/jacoco-aggregate/junixsocket-ssl/org.newsclub.net.unix.ssl/SSLContextBuilder.java.html Instantiates a new PKCS12 KeyStore. It uses a pre-configured provider if available, otherwise defaults to the standard Java mechanism. ```java public static KeyStore newKeyStorePKCS12() throws KeyStoreException { if (PROVIDER_PKCS12 == null) { return KeyStore.getInstance("PKCS12"); } else { return KeyStore.getInstance("PKCS12", PROVIDER_PKCS12); } } ``` -------------------------------- ### shutdown() Source: https://kohlschutter.github.io/junixsocket/apidocs/index-all.html Asks that this RMI registry gets shut down. ```APIDOC ## shutdown() ### Description Asks that this RMI registry gets shut down. ### Method N/A (Method Signature) ### Endpoint N/A ``` -------------------------------- ### Simple RMI Client Implementation Source: https://kohlschutter.github.io/junixsocket/junixsocket-demo/xref/org/newsclub/net/unix/demo/rmi/SimpleRMIClientActingAsServer.html This is the main method of the RMI client. It initializes AFUNIXNaming, locates the RMI registry, looks up a remote 'helloWorld' service, exports a local 'world' service, and then calls methods on the remote service. Finally, it unexports the local service. ```java package org.newsclub.net.unix.demo.rmi; import java.io.IOException; import java.rmi.NotBoundException; import java.rmi.registry.Registry; import java.rmi.server.RemoteObject; import org.newsclub.net.unix.demo.rmi.services.HelloWorld; import org.newsclub.net.unix.demo.rmi.services.World; import org.newsclub.net.unix.rmi.AFUNIXNaming; import org.newsclub.net.unix.rmi.RemotePeerInfo; /** * A simple RMI client. Locates the RMI registry via AF_UNIX sockets and calls * {@link HelloWorld#hello()}. * * @author Christian Kohlschütter */ @SuppressWarnings("CatchAndPrintStackTrace" _/* errorprone */_) public final class SimpleRMIClientActingAsServer { public static void main(String[] args) throws IOException, NotBoundException { AFUNIXNaming naming = AFUNIXNaming.getInstance(); System.out.println("Locating registry..."); final Registry registry = naming.getRegistry(); System.out.println(registry); System.out.println(); HelloWorld obj = (HelloWorld) registry.lookup("helloWorld"); System.out.println("HelloWorld instance:"); System.out.println(" " + obj); System.out.println(" " + RemotePeerInfo.remotePeerCredentials(obj)); System.out.println(); World world = new WorldImpl("everybody"); naming.exportAndRebind("world", world); System.out.println("Exporting our own World instance:"); System.out.println(" " + RemoteObject.toStub(world)); System.out.println(" " + RemotePeerInfo.remotePeerCredentials(world)); System.out.println(); System.out.println("Calling HelloWorld..."); System.out.println(obj.hello() + " " + obj.world() + "!"); /* * Uncommenting the line below keeps this instance running. * * Try it and run SimpleRMIClient to see the difference. */ naming.unexportAndUnbind("world", world); /* * Also try to remotely shut down the registry. * * This will not succeed if the server set {@code naming.setRemoteShutdownAllowed(false)}. See * {@link SimpleRMIServer} */ // naming.shutdownRegistry(); } } ``` -------------------------------- ### get() - RemoteCloseable Source: https://kohlschutter.github.io/junixsocket/apidocs/index-all.html Returns the resource or its Remote instance. ```APIDOC ## get() ### Description Returns the resource (or the Remote instance of it). ### Method Method in interface org.newsclub.net.unix.rmi.RemoteCloseable ``` -------------------------------- ### AFSYSTEMServerSocket.newInstance() Source: https://kohlschutter.github.io/junixsocket/junixsocket-darwin/apidocs/org.newsclub.net.unix.darwin/org/newsclub/net/unix/darwin/system/class-use/AFSYSTEMServerSocket.html Creates a new, unbound AF_SYSTEM ServerSocket. ```APIDOC ## AFSYSTEMServerSocket.newInstance() ### Description Returns a new, unbound AF_SYSTEM `ServerSocket`. ### Method `static AFSYSTEMServerSocket` ``` -------------------------------- ### get() Method Source: https://kohlschutter.github.io/junixsocket/junixsocket-codecoverage/jacoco-aggregate/junixsocket-rmi/org.newsclub.net.unix.rmi/RemoteCloseableImpl.java.html Retrieves the wrapped remote object. ```APIDOC ## T get() ### Description Returns the underlying remote object that was wrapped by this `RemoteCloseableImpl` instance. ### Returns - **T** - The wrapped remote object. ### Throws - **IOException** - If an error occurs while accessing the remote object (though typically this method itself does not throw if the object is readily available). ``` -------------------------------- ### getInetAddress Source: https://kohlschutter.github.io/junixsocket/junixsocket-codecoverage/jacoco-aggregate/junixsocket-common/org.newsclub.net.unix/AFServerSocket.java.html Gets the InetAddress of the bound socket, if bound. ```APIDOC ## getInetAddress ### Description Returns the {@link InetAddress} of the bound socket. Returns {@code null} if the socket is not bound. ### Returns - The {@link InetAddress} of the socket, or {@code null} if not bound. ``` -------------------------------- ### configure Method Source: https://kohlschutter.github.io/junixsocket/apidocs/org.newsclub.net.unix.tipc/org/newsclub/net/unix/tipc/AFTIPCSocketFactory.html Performs optional configuration on a newly created TIPC socket before it is returned. ```APIDOC ## configure(AFTIPCSocket sock) ### Description Performs some optional configuration on a newly created socket. ### Parameters * **sock** (AFTIPCSocket) - The socket to configure. ### Returns * **AFTIPCSocket** - The configured socket instance. ### Throws * **SocketException** - If an error occurs during configuration. ``` -------------------------------- ### RemotePeerInfo.getPort Source: https://kohlschutter.github.io/junixsocket/apidocs/org.newsclub.net.unix.rmi/org/newsclub/net/unix/rmi/RemotePeerInfo.html Gets the port number of the remote peer. ```APIDOC ## getPort ### Description The port. ### Method `int` ### Returns - `int` - The port ``` -------------------------------- ### Instance Creation and Configuration Source: https://kohlschutter.github.io/junixsocket/apidocs/org.newsclub.net.unix/org/newsclub/net/unix/AFServerSocket.html Methods for creating new channel instances, socket implementations, and server socket instances with various configurations. ```APIDOC ## Method Details ### newChannel protected abstract AFServerSocketChannel newChannel() Creates a new AFServerSocketChannel for this socket. Returns: The new instance. ### newImpl protected abstract AFSocketImpl newImpl(FileDescriptor fdObj) throws IOException Creates a new AFSocketImpl. Parameters: `fdObj` - The file descriptor. Returns: The new instance. Throws: `IOException` - on error. ### newInstance protected static AFServerSocket newInstance(AFServerSocket.Constructor instanceSupplier) throws IOException Creates a new AFServerSocket instance, using the given subclass constructor. Type Parameters: `A` - The concrete `AFSocketAddress` that is supported by this type. Parameters: `instanceSupplier` - The subclass constructor. Returns: The new instance. Throws: `IOException` - on error. ### newInstance protected static AFServerSocket newInstance(AFServerSocket.Constructor instanceSupplier, FileDescriptor fdObj, int localPort, int remotePort) throws IOException Creates a new AFServerSocket instance, using the given subclass constructor. Type Parameters: `A` - The concrete `AFSocketAddress` that is supported by this type. Parameters: `instanceSupplier` - The subclass constructor. `fdObj` - The file descriptor. `localPort` - The local port. `remotePort` - The remote port. Returns: The new instance. Throws: `IOException` - on error. ``` -------------------------------- ### Create SSLEngine with Host and Port Source: https://kohlschutter.github.io/junixsocket/junixsocket-codecoverage/jacoco-aggregate/junixsocket-ssl/org.newsclub.net.unix.ssl/BuilderSSLContext.java.html Creates and initializes an SSLEngine for a specific host and port. This is useful for client-side connections where the target server is known. ```java @Override protected SSLEngine engineCreateSSLEngine(String host, int port) { return init(context.createSSLEngine(host, port)); } ``` -------------------------------- ### getLocalAddress Source: https://kohlschutter.github.io/junixsocket/apidocs/org.newsclub.net.unix/org/newsclub/net/unix/AFServerSocketChannel.html Gets the socket's local address. ```APIDOC ## Method getLocalAddress public final @Nullable A getLocalAddress() ### Description Returns the socket's local address. ### Returns The socket's local address, or `null` if it is not bound. ``` -------------------------------- ### initPre Source: https://kohlschutter.github.io/junixsocket/junixsocket-codecoverage/jacoco-aggregate/junixsocket-common/org.newsclub.net.unix/NativeUnixSocket.java.html Performs pre-initialization steps by attempting to resolve necessary Java classes. ```APIDOC ## initPre() ### Description Executes pre-initialization routines required for JNI operations. This method attempts to resolve several critical Java classes using `Class.forName()` to ensure they are available before the native library is fully initialized. This is often necessary in certain environments where JNI's `FindClass` might fail otherwise. ### Details This method calls `tryResolveClass` for the following classes: - `AbstractSelectableChannel.class.getName()` - `java.lang.ProcessBuilder$RedirectPipeImpl` - `InetSocketAddress.class.getName()` - `InvalidArgumentSocketException` - `AddressUnavailableSocketException` - `OperationNotSupportedSocketException` - `NoSuchDeviceSocketException` - `BrokenPipeSocketException` - `ConnectionResetSocketException` - `SocketClosedException` ``` -------------------------------- ### Options Source: https://kohlschutter.github.io/junixsocket/apidocs/org.newsclub.net.unix/org/newsclub/net/unix/AFDatagramChannel.html Methods for getting and setting socket options. ```APIDOC final T getOption(SocketOption name) ``` ```APIDOC final AFDatagramChannel setOption(SocketOption name, T value) ``` ```APIDOC final Set> supportedOptions() ``` -------------------------------- ### AFUNIXServerSocket.newInstance() Source: https://kohlschutter.github.io/junixsocket/apidocs/org.newsclub.net.unix/org/newsclub/net/unix/class-use/AFUNIXServerSocket.html Returns a new, unbound AF_UNIX ServerSocket. ```APIDOC ## AFUNIXServerSocket.newInstance() ### Description Returns a new, unbound AF_UNIX `ServerSocket`. ### Method `static AFUNIXServerSocket` ### Return Value A new, unbound `AFUNIXServerSocket`. ``` -------------------------------- ### getOption(SocketOption name) Source: https://kohlschutter.github.io/junixsocket/apidocs/org.newsclub.net.unix/org/newsclub/net/unix/AFDatagramSocketImpl.html Gets a socket option. ```APIDOC ## getOption(SocketOption name) ### Description Gets a socket option. ### Parameters * `name` - The name of the socket option. ### Returns The value of the socket option. ### Throws * `IOException` ``` -------------------------------- ### AFSYSTEMServerSocket.newInstance Source: https://kohlschutter.github.io/junixsocket/apidocs/index-all.html Returns a new, unbound AF_SYSTEM ServerSocket. ```APIDOC ## newInstance() ### Description Returns a new, unbound AF_SYSTEM `ServerSocket`. ### Method N/A (Method signature provided) ### Endpoint N/A ### Parameters None ### Request Example N/A ### Response #### Success Response (200) - **AFSYSTEMServerSocket** - A new, unbound AF_SYSTEM ServerSocket instance. #### Response Example N/A ``` -------------------------------- ### Getting Channel from AFVSOCKServerSocket Source: https://kohlschutter.github.io/junixsocket/junixsocket-vsock/apidocs/org.newsclub.net.unix.vsock/org/newsclub/net/unix/vsock/class-use/AFVSOCKServerSocketChannel.html Retrieves the AFVSOCKServerSocketChannel associated with an AFVSOCKServerSocket. ```APIDOC ## AFVSOCKServerSocketChannel getChannel() ### Description Returns the channel associated with this server socket. ### Method `AFVSOCKServerSocketChannel` ### Endpoint `AFVSOCKServerSocket.getChannel()` ``` -------------------------------- ### Configuring KeyStore Source: https://kohlschutter.github.io/junixsocket/apidocs/org.newsclub.net.unix.ssl/org/newsclub/net/unix/ssl/class-use/SSLContextBuilder.html Configure the builder to use a keystore identified by a file path or URL and a password. ```APIDOC ## SSLContextBuilder.withKeyStore(File path, SSLSupplier password) ### Description Configures this builder to use the given keystore, identified by path and password. ### Method `SSLContextBuilder` ### Endpoint `SSLContextBuilder.withKeyStore(File path, SSLSupplier password)` ``` ```APIDOC ## SSLContextBuilder.withKeyStore(URL url, SSLSupplier password) ### Description Configures this builder to use the given keystore, identified by URL and password. ### Method `SSLContextBuilder` ### Endpoint `SSLContextBuilder.withKeyStore(URL url, SSLSupplier password)` ``` -------------------------------- ### getInstance Source: https://kohlschutter.github.io/junixsocket/junixsocket-rmi/jacoco/org.newsclub.net.unix.rmi/AFNaming.java.html Static method to get or create an instance of AFNaming. ```APIDOC ## getInstance(int registryPort, AFNamingProvider provider) ### Description Gets or creates an instance of AFNaming for the given registry port and provider. ### Parameters * **registryPort** (int) - The registry port. * **provider** (AFNamingProvider) - The provider for the AFNaming instance. ### Returns The AFNaming instance of type T. ### Throws * RemoteException on error. ``` -------------------------------- ### connect Method Source: https://kohlschutter.github.io/junixsocket/apidocs/org.newsclub.net.mysql/org/newsclub/net/mysql/AFUNIXDatabaseSocketFactoryCJ.html Establishes a socket connection to a MySQL server using UNIX domain sockets. ```APIDOC ## connect(String hostname, int portNumber, com.mysql.cj.conf.PropertySet props, int loginTimeout) ### Description Establishes a socket connection to a MySQL server. ### Method `connect` ### Parameters - **hostname** (String) - The hostname of the server. - **portNumber** (int) - The port number of the server. - **props** (com.mysql.cj.conf.PropertySet) - The property set for the connection. - **loginTimeout** (int) - The login timeout in seconds. ### Throws - `IOException` ``` -------------------------------- ### SocketServer.onSubmitted Source: https://kohlschutter.github.io/junixsocket/apidocs/index-all.html Called when a socket gets submitted into the process queue. ```APIDOC ## SocketServer.onSubmitted(S, Future) ### Description Called when a socket gets submitted into the process queue. ### Method Instance method ### Parameters #### Path Parameters - **S** (type) - Description of the socket. - **Future** (Future) - Description of the future. ``` -------------------------------- ### Methods Source: https://kohlschutter.github.io/junixsocket/junixsocket-jetty/apidocs/org/newsclub/net/unix/jetty/AFSocketServerConnector.html Instance methods for configuring and managing the AF_UNIX socket server connector. ```APIDOC ## Method Summary All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description `protected void accept(int acceptorID)` `protected void configure(SocketChannel channel)` Configures an incoming `SocketChannel`, setting socket options such as receive and send buffer sizes. `protected void doStart()` `protected void doStop()` `int getAcceptedReceiveBufferSize()` Returns the SO_RCVBUF size for accepted sockets. `int getAcceptedSendBufferSize()` Returns the SO_SNDBUF size for accepted sockets. `int getAcceptQueueSize()` Returns the accept queue size (backlog) for the server socket. `org.newsclub.net.unix.AFSocketAddress getListenSocketAddress()` Returns the socket address this connector listens to. `Object getTransport()` `Path getUnixDomainPath()` Deprecated. Use `getListenSocketAddress()` instead. `boolean isInheritChannel()` Checks whether this connector uses a server channel inherited from the JVM. `boolean isMayStopServer()` Checks if this connector may stop the server when it's no longer able to serve and no other connectors are available. `boolean isMayStopServerForce()` Checks if this connector may stop the server when it's no longer able to serve, even if other connectors are available. `void setAcceptedReceiveBufferSize(int acceptedReceiveBufferSize)` Sets the SO_RCVBUF size for accepted sockets. `void setAcceptedSendBufferSize(int acceptedSendBufferSize)` Sets the SO_SNDBUF size for accepted sockets. `void setAccepting(boolean accepting)` `void setAcceptQueueSize(int acceptQueueSize)` Sets the accept queue size (backlog) for the server socket. `void setInheritChannel(boolean inheritChannel)` Sets whether this connector uses a server channel inherited from the JVM. `void setListenSocketAddress(org.newsclub.net.unix.AFSocketAddress addr)` Sets the socket address this connector listens to. `void setMayStopServer(boolean mayStopServer)` Sets if this connector may stop the server when it's no longer able to serve and no other connectors are available. `void setMayStopServerForce(boolean b)` Sets if this connector may stop the server when it's no longer able to serve and no other connectors are available. `void setUnixDomainPath(Path unixDomainPath)` Deprecated. Use `setListenSocketAddress(AFSocketAddress)` instead. `String toString()` ``` -------------------------------- ### get() Source: https://kohlschutter.github.io/junixsocket/junixsocket-common/jacoco/org.newsclub.net.unix/AFFuture.java.html Waits if necessary for the computation to complete, and then retrieves its result. ```APIDOC ## Method get() ### Description Waits if necessary for the computation to complete, and then retrieves its result. ### Returns the computed result ### Throws * `CancellationException` if the computation was cancelled * `ExecutionException` if the computation threw an exception * `InterruptedException` if the current thread was interrupted while waiting ```