Class UnixChannelUtil

java.lang.Object
io.netty.channel.unix.UnixChannelUtil

public final class UnixChannelUtil extends Object
  • Field Details

  • Constructor Details

    • UnixChannelUtil

      private UnixChannelUtil()
  • Method Details

    • isFileChannelImpl

      public static boolean isFileChannelImpl(FileChannel channel)
      Returns whether the given channel is an instance of sun.nio.ch.FileChannelImpl.
    • isBufferCopyNeededForWrite

      public static boolean isBufferCopyNeededForWrite(ByteBuf byteBuf)
      Checks if the specified buffer has memory address or is composed of n(n invalid input: '<'= IOV_MAX) NIO direct buffers. (We check this because otherwise we need to make it a new direct buffer.)
    • isBufferCopyNeededForWrite

      static boolean isBufferCopyNeededForWrite(ByteBuf byteBuf, int iovMax)
    • deleteDomainSocketFile

      public static boolean deleteDomainSocketFile(String path)
      Delete the file at path but only if it is a socket inode (as left behind by a bound domain socket). Any other kind of file (regular file, directory, symbolic link, FIFO, device, ...) is left alone. Symbolic links are never followed. This requires Java 7 or later, on older versions nothing is deleted.
      Returns:
      true if the file was deleted.
    • isSocket

      private static boolean isSocket(Path file) throws IOException
      Throws:
      IOException
    • computeRemoteAddr

      public static InetSocketAddress computeRemoteAddr(InetSocketAddress remoteAddr, InetSocketAddress osRemoteAddr)