Class UnixChannelUtil
java.lang.Object
io.netty.channel.unix.UnixChannelUtil
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Class<?> private static final intprivate static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic InetSocketAddresscomputeRemoteAddr(InetSocketAddress remoteAddr, InetSocketAddress osRemoteAddr) static booleandeleteDomainSocketFile(String path) Delete the file atpathbut only if it is a socket inode (as left behind by a bound domain socket).static booleanisBufferCopyNeededForWrite(ByteBuf byteBuf) Checks if the specified buffer has memory address or is composed of n(n invalid input: '<'= IOV_MAX) NIO direct buffers.(package private) static booleanisBufferCopyNeededForWrite(ByteBuf byteBuf, int iovMax) static booleanisFileChannelImpl(FileChannel channel) Returns whether the given channel is an instance ofsun.nio.ch.FileChannelImpl.private static boolean
-
Field Details
-
S_IFMT
private static final int S_IFMT- See Also:
-
S_IFSOCK
private static final int S_IFSOCK- See Also:
-
FILE_CHANNEL_IMPL_CLASS
-
-
Constructor Details
-
UnixChannelUtil
private UnixChannelUtil()
-
-
Method Details
-
isFileChannelImpl
Returns whether the given channel is an instance ofsun.nio.ch.FileChannelImpl. -
isBufferCopyNeededForWrite
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
-
deleteDomainSocketFile
Delete the file atpathbut 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:
trueif the file was deleted.
-
isSocket
- Throws:
IOException
-
computeRemoteAddr
public static InetSocketAddress computeRemoteAddr(InetSocketAddress remoteAddr, InetSocketAddress osRemoteAddr)
-