Class AFVSOCKProxyServerSocketConnector

java.lang.Object
org.newsclub.net.unix.vsock.AFVSOCKProxyServerSocketConnector
All Implemented Interfaces:
org.newsclub.net.unix.AFServerSocketConnector<org.newsclub.net.unix.AFVSOCKSocketAddress, org.newsclub.net.unix.AFSocketAddress>

public final class AFVSOCKProxyServerSocketConnector extends Object implements org.newsclub.net.unix.AFServerSocketConnector<org.newsclub.net.unix.AFVSOCKSocketAddress, org.newsclub.net.unix.AFSocketAddress>
Provides access to AF_VSOCK connections that aren't directly accessible but exposed via a proxying/multiplexing Unix domain socket.
Author:
Christian Kohlschütter
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    org.newsclub.net.unix.AFServerSocket<?>
    bind(org.newsclub.net.unix.AFVSOCKSocketAddress addr)
     
    static org.newsclub.net.unix.AFServerSocketConnector<org.newsclub.net.unix.AFVSOCKSocketAddress, org.newsclub.net.unix.AFSocketAddress>
    Returns an instance that is configured to connect directly to the given address.
    static org.newsclub.net.unix.AFServerSocketConnector<org.newsclub.net.unix.AFVSOCKSocketAddress, org.newsclub.net.unix.AFSocketAddress>
    openFirecrackerStyleConnector(File listenAddressPrefix, int allowedCID)
    Returns an instance that is configured to support [Firecracker-style](https://github.com/firecracker-microvm/firecracker/blob/main/docs/vsock.md) Unix domain sockets.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • openFirecrackerStyleConnector

      public static org.newsclub.net.unix.AFServerSocketConnector<org.newsclub.net.unix.AFVSOCKSocketAddress, org.newsclub.net.unix.AFSocketAddress> openFirecrackerStyleConnector(File listenAddressPrefix, int allowedCID)
      Returns an instance that is configured to support [Firecracker-style](https://github.com/firecracker-microvm/firecracker/blob/main/docs/vsock.md) Unix domain sockets.
      Parameters:
      listenAddressPrefix - The prefix of any listening socket. The actual socket will have _vsockPort appended to it (with vsockPort being replaced by the corresponding port number).
      allowedCID - The permitted CID, or AFVSOCKSocketAddress.VMADDR_CID_ANY for "any".
      Returns:
      The instance.
    • openDirectConnector

      public static org.newsclub.net.unix.AFServerSocketConnector<org.newsclub.net.unix.AFVSOCKSocketAddress, org.newsclub.net.unix.AFSocketAddress> openDirectConnector()
      Returns an instance that is configured to connect directly to the given address.
      Returns:
      The direct instance.
    • bind

      public org.newsclub.net.unix.AFServerSocket<?> bind(org.newsclub.net.unix.AFVSOCKSocketAddress addr) throws IOException
      Specified by:
      bind in interface org.newsclub.net.unix.AFServerSocketConnector<org.newsclub.net.unix.AFVSOCKSocketAddress, org.newsclub.net.unix.AFSocketAddress>
      Throws:
      IOException