Enum AFSocketCapability

All Implemented Interfaces:
Serializable, Comparable<AFSocketCapability>, java.lang.constant.Constable

public enum AFSocketCapability extends Enum<AFSocketCapability>
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).
  • Enum Constant Details


      public static final AFSocketCapability CAPABILITY_PEER_CREDENTIALS
      Socket supports retrieving peer credentials.

      public static final AFSocketCapability CAPABILITY_ANCILLARY_MESSAGES
      Socket supports sending and receiving ancillary messages.

      public static final AFSocketCapability CAPABILITY_FILE_DESCRIPTORS
      Socket supports passing file descriptors via ancillary messages.

      public static final AFSocketCapability CAPABILITY_ABSTRACT_NAMESPACE
      Socket addressing supports the abstract namespace (Linux).

      public static final AFSocketCapability CAPABILITY_UNIX_DATAGRAMS
      Support for AF_UNIX datagrams (not on Windows yet).

      public static final AFSocketCapability 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 use AFSocketPair. Other systems, such as OSv, may provide partial implementations of pipe-based (i.e., non-socket) pairs.

      public static final AFSocketCapability CAPABILITY_FD_AS_REDIRECT
      A file descriptor can be converted to ProcessBuilder.Redirect. This feature currently uses Java SDK internals that may change/disappear.

      public static final AFSocketCapability 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.

      public static final AFSocketCapability 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.
  • Method Details

    • values

      public static AFSocketCapability[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static AFSocketCapability valueOf(String name)
      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.)
      name - the name of the enum constant to be returned.
      the enum constant with the specified name
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null