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 AFVSOCKSocketFactory
AFVSOCKSocketFactory.FixedAddressModifier and TypeClassDescriptionstatic final classAlways connects sockets to the given VSOCK type and instance.Nested classes/interfaces inherited from class AFSocketFactory
AFSocketFactory.FixedAddressSocketFactoryModifier and TypeClassDescriptionstatic final classA socket factory that always connects to a fixed socket address, no matter what. -
Constructor Summary
ConstructorsConstructorDescriptionFixedAddress(int port, int cid) Creates anAFVSOCKSocketFactorythat always uses the given VSOCK address.Creates anAFVSOCKSocketFactorythat 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 AFVSOCKSocketFactory
configure, connectTo, createSocketModifier and TypeMethodDescriptionprotected AFVSOCKSocketconfigure(AFVSOCKSocket sock) Performs some optional configuration on a newly created socket.protected final AFVSOCKSocketCreates a newAFSocket, connected to the given address.final SocketMethods inherited from class AFSocketFactory
createSocket, createSocket, createSocket, createSocket, isInetAddressSupportedModifier and TypeMethodDescriptionfinal SocketcreateSocket(String host, int port) final SocketcreateSocket(String host, int port, InetAddress localHost, int localPort) final SocketcreateSocket(InetAddress address, int port) final SocketcreateSocket(InetAddress address, int port, InetAddress localAddress, int localPort) protected final booleanisInetAddressSupported(InetAddress address) Checks whether the givenInetAddressis supported by this socket factory.Methods inherited from class SocketFactory
getDefaultMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AFSocketAddressFromHostname
isHostnameSupportedModifier and TypeMethodDescriptiondefault booleanisHostnameSupported(String host) Checks whether the given hostname is supported by this socket factory.
-
Constructor Details
-
FixedAddress
Creates anAFVSOCKSocketFactorythat always uses the given VSOCK address.- Parameters:
port- The VSOCK port.cid- The VSOCK CID.- Throws:
SocketException- on internal error.
-
FixedAddress
Creates anAFVSOCKSocketFactorythat always uses the given VSOCK address.- Parameters:
addr- The address.
-
-
Method Details
-
addressFromHost
Description copied from interface:AFSocketAddressFromHostnameTranslates 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
-