Module org.newsclub.net.unix.vsock
Package org.newsclub.net.unix.vsock
Class AFVSOCKProxyServerSocketConnector
java.lang.Object
org.newsclub.net.unix.vsock.AFVSOCKProxyServerSocketConnector
- All Implemented Interfaces:
AFServerSocketConnector<AFVSOCKSocketAddress,AFSocketAddress>
public final class AFVSOCKProxyServerSocketConnector
extends Object
implements AFServerSocketConnector<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 TypeMethodDescriptionbind(AFVSOCKSocketAddress addr) Creates anAFServerSocketbound to the given address.Returns an instance that is configured to connect directly to the given address.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.
-
Method Details
-
openFirecrackerStyleConnector
public static AFServerSocketConnector<AFVSOCKSocketAddress,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_vsockPortappended to it (withvsockPortbeing replaced by the corresponding port number).allowedCID- The permitted CID, orAFVSOCKSocketAddress.VMADDR_CID_ANYfor "any".- Returns:
- The instance.
-
openDirectConnector
Returns an instance that is configured to connect directly to the given address.- Returns:
- The direct instance.
-
bind
Description copied from interface:AFServerSocketConnectorCreates anAFServerSocketbound to the given address.- Specified by:
bindin interfaceAFServerSocketConnector<AFVSOCKSocketAddress,AFSocketAddress> - Parameters:
addr- The address to bind to.- Returns:
- The bound socket.
- Throws:
IOException- on error.
-