Module org.newsclub.net.unix.vsock
Package org.newsclub.net.unix.vsock
Class AFVSOCKProxySocketConnector
java.lang.Object
org.newsclub.net.unix.vsock.AFVSOCKProxySocketConnector
- All Implemented Interfaces:
AFSocketConnector<AFVSOCKSocketAddress,
AFSocketAddress>
public final class AFVSOCKProxySocketConnector
extends Object
implements AFSocketConnector<AFVSOCKSocketAddress,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 TypeMethodDescriptionAFSocket
<?> connect
(AFVSOCKSocketAddress vsockAddress) Connects to the given AF_VSOCK address.Returns an instance that is configured to connect directly to the given address.openFirecrackerStyleConnector
(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.
-
Method Details
-
openFirecrackerStyleConnector
public static AFSocketConnector<AFVSOCKSocketAddress,AFSocketAddress> openFirecrackerStyleConnector(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, orAFVSOCKSocketAddress.VMADDR_CID_ANY
for "any".- Returns:
- The instance.
-
openDirectConnector
Returns an instance that is configured to connect directly to the given address.- Returns:
- The direct instance.
-
connect
Connects to the given AF_VSOCK address.- Specified by:
connect
in interfaceAFSocketConnector<AFVSOCKSocketAddress,
AFSocketAddress> - Parameters:
vsockAddress
- The address to connect to.- Returns:
- The connected socket.
- Throws:
IOException
- on error.AddressUnavailableSocketException
- if the CID is not covered by this connector.
-