Module org.newsclub.net.unix.vsock
Package org.newsclub.net.unix.vsock
Class AFVSOCKSocketFactory.FixedAddress
java.lang.Object
javax.net.SocketFactory
org.newsclub.net.unix.AFSocketFactory<AFVSOCKSocketAddress>
org.newsclub.net.unix.vsock.AFVSOCKSocketFactory
org.newsclub.net.unix.vsock.AFVSOCKSocketFactory.FixedAddress
- All Implemented Interfaces:
AFSocketAddressFromHostname<AFVSOCKSocketAddress>
- Enclosing class:
AFVSOCKSocketFactory
Always connects sockets to the given VSOCK type and instance.
- Author:
- Christian Kohlschütter
-
Nested Class Summary
Nested classes/interfaces inherited from class org.newsclub.net.unix.vsock.AFVSOCKSocketFactory
AFVSOCKSocketFactory.FixedAddress
Nested classes/interfaces inherited from class org.newsclub.net.unix.AFSocketFactory
AFSocketFactory.FixedAddressSocketFactory
-
Constructor Summary
ConstructorDescriptionFixedAddress
(int port, int cid) Creates anAFVSOCKSocketFactory
that always uses the given VSOCK address.Creates anAFVSOCKSocketFactory
that always uses the given VSOCK address. -
Method Summary
Modifier and TypeMethodDescriptionaddressFromHost
(String host, int javaPort) Translates a "host" string (and port) to anAFSocketAddress
.Methods inherited from class org.newsclub.net.unix.vsock.AFVSOCKSocketFactory
configure, connectTo, createSocket
Methods inherited from class org.newsclub.net.unix.AFSocketFactory
createSocket, createSocket, createSocket, createSocket, isInetAddressSupported
Methods inherited from class javax.net.SocketFactory
getDefault
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.newsclub.net.unix.AFSocketAddressFromHostname
isHostnameSupported
-
Constructor Details
-
FixedAddress
Creates anAFVSOCKSocketFactory
that always uses the given VSOCK address.- Parameters:
port
- The VSOCK port.cid
- The VSOCK CID.- Throws:
SocketException
- on internal error.
-
FixedAddress
Creates anAFVSOCKSocketFactory
that always uses the given VSOCK address.- Parameters:
addr
- The address.
-
-
Method Details
-
addressFromHost
Description copied from interface:AFSocketAddressFromHostname
Translates a "host" string (and port) to anAFSocketAddress
.- Parameters:
host
- The hostnamejavaPort
- The port, or 0.- Returns:
- The
AFSocketAddress
- Throws:
SocketException
- If there was a problem converting the hostname
-