- All Implemented Interfaces:
Serializable,Comparable<AFSocketCapability>,java.lang.constant.Constable
Describes junixsocket capabilities the current environment (system platform, native library,
etc.) may or may not support.
You can check whether your environment supports a given capability by calling
AFSocket.supports(AFSocketCapability).-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionSocket addressing supports the abstract namespace (Linux).Socket supports sending and receiving ancillary messages.A file descriptor can be converted toProcessBuilder.Redirect.Socket supports passing file descriptors via ancillary messages.A pair of interconnected sockets can be created natively as AF_UNIX sockets.Socket supports retrieving peer credentials.Support for AF_TIPC.Support for AF_UNIX datagrams (not on Windows yet).Support for AF_UNIX.Support for AF_VSOCK.Support for AF_VSOCK datagrams (not all platforms/kernel versions or configurations support this).Support for zero-length send(2). -
Method Summary
Modifier and TypeMethodDescriptionstatic AFSocketCapabilityReturns the enum constant of this type with the specified name.static AFSocketCapability[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
CAPABILITY_PEER_CREDENTIALS
Socket supports retrieving peer credentials. -
CAPABILITY_ANCILLARY_MESSAGES
Socket supports sending and receiving ancillary messages. -
CAPABILITY_FILE_DESCRIPTORS
Socket supports passing file descriptors via ancillary messages. -
CAPABILITY_ABSTRACT_NAMESPACE
Socket addressing supports the abstract namespace (Linux). -
CAPABILITY_UNIX_DATAGRAMS
Support for AF_UNIX datagrams (not on Windows yet). -
CAPABILITY_NATIVE_SOCKETPAIR
A pair of interconnected sockets can be created natively as AF_UNIX sockets. This currently not possible on Windows, but instead emulated via anonymous AF_INET ports when you useAFSocketPair. Other systems may provide partial implementations of pipe-based (i.e., non-socket) pairs. This capability is specific to AF_UNIX sockets. Other sockets, such as AF_VSOCK, may not implement socketpair natively even if this capability is set, but would work-around that limitation in a similar fashion but maybe without resorting to AF_INET. -
CAPABILITY_FD_AS_REDIRECT
A file descriptor can be converted toProcessBuilder.Redirect. This feature currently uses Java SDK internals that may change/disappear. -
CAPABILITY_TIPC
Support for AF_TIPC. Availability of this feature is checked upon launch and therefore loading the "tipc" kernel module at a later point may not be properly reflected. -
CAPABILITY_UNIX_DOMAIN
Support for AF_UNIX. Availability of this feature is checked upon launch and therefore, on systems adding support at a later point, may not be properly reflected when checking at a later point. NOTE: While this capability is typically supported on most systems that can actually load a junixsocket JNI library, it is unavailable for older Windows versions (such as 8.1, 10 before AFUNIX.SYS was included, etc.) and on systems where support for UNIX domain sockets is actively disabled. Therefore, it is still recommended to check for this capability. -
CAPABILITY_VSOCK
Support for AF_VSOCK. Availability of this feature is checked upon launch and therefore enabling vsock at a later point may not be properly reflected.- See Also:
-
CAPABILITY_VSOCK_DGRAM
Support for AF_VSOCK datagrams (not all platforms/kernel versions or configurations support this). Availability of this feature is checked upon launch and therefore enabling vsock at a later point may not be properly reflected. -
CAPABILITY_ZERO_LENGTH_SEND
Support for zero-length send(2). This can be used to perform a connection check, but not all operating systems support this or behave correctly (particularly, IBM AIX, IBM i, and IBM z/OS) at the moment. If not supported, junixsocket will simply ignore writes of zero-length, and connection checking withAFSocket.checkConnectionClosed()may returnfalseregardless of the actual condition.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-