Class AFVSOCKProxySocketConnector

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

public final class AFVSOCKProxySocketConnector extends Object implements org.newsclub.net.unix.AFSocketConnector<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.AFSocket<?>
    connect(org.newsclub.net.unix.AFVSOCKSocketAddress vsockAddress)
    Connects to the given AF_VSOCK address.
    static org.newsclub.net.unix.AFSocketConnector<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.AFSocketConnector<org.newsclub.net.unix.AFVSOCKSocketAddress, org.newsclub.net.unix.AFSocketAddress>
    openFirecrackerStyleConnector(org.newsclub.net.unix.AFUNIXSocketAddress connectorAddress, 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.AFSocketConnector<org.newsclub.net.unix.AFVSOCKSocketAddress, org.newsclub.net.unix.AFSocketAddress> openFirecrackerStyleConnector(org.newsclub.net.unix.AFUNIXSocketAddress connectorAddress, 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:
      connectorAddress - The unix socket address pointing at the Firecracker-style multiplexing domain socket.
      allowedCID - The permitted CID, or AFVSOCKSocketAddress.VMADDR_CID_ANY for "any".
      Returns:
      The instance.
    • openDirectConnector

      public static org.newsclub.net.unix.AFSocketConnector<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.
    • connect

      public org.newsclub.net.unix.AFSocket<?> connect(org.newsclub.net.unix.AFVSOCKSocketAddress vsockAddress) throws IOException
      Connects to the given AF_VSOCK address.
      Specified by:
      connect in interface org.newsclub.net.unix.AFSocketConnector<org.newsclub.net.unix.AFVSOCKSocketAddress, org.newsclub.net.unix.AFSocketAddress>
      Parameters:
      vsockAddress - The address to connect to.
      Returns:
      The connected socket.
      Throws:
      IOException - on error.
      org.newsclub.net.unix.AddressUnavailableSocketException - if the CID is not covered by this connector.