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:
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 TypeMethodDescriptionorg.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.
-
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 (withvsockPort
being replaced by the corresponding port number).allowedCID
- The permitted CID, orAFVSOCKSocketAddress.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 interfaceorg.newsclub.net.unix.AFServerSocketConnector<org.newsclub.net.unix.AFVSOCKSocketAddress,
org.newsclub.net.unix.AFSocketAddress> - Throws:
IOException
-