Top Description Fields Constructors Methods
io.netty.channel.epoll

public final Class EpollEventArray

extends Object
Class Inheritance
Annotations
@UnstableApi
Imports
io.netty.channel.unix.Buffer, io.netty.util.internal.PlatformDependent, .UnstableApi, java.nio.ByteBuffer

This is an internal datastructure which can be directly passed to epoll_wait to reduce the overhead. typedef union epoll_data { void *ptr; int fd; uint32_t u32; uint64_t u64; } epoll_data_t; struct epoll_event { uint32_t events; // Epoll events epoll_data_t data; // User data variable }; We use fd if the epoll_data union to store the actual file descriptor of an AbstractEpollChannel and so be able to map it later.

Field Summary

Modifier and TypeField and Description
private static final int
private static final int
private int
private ByteBuffer
private long

Constructor Summary

AccessConstructor and Description
pack-priv
EpollEventArray(int length)

Method Summary

Modifier and TypeMethod and Description
private static int
pack-priv int
events(int index)

Return the events for the epoll_event on this index.

pack-priv int
fd(int index)

Return the file descriptor for the epoll_event on this index.

pack-priv void
free()

Free this EpollEventArray.

private int
getInt(int index, int offset)

pack-priv void
increase()

Increase the storage of this EpollEventArray.

pack-priv int
length()

Return the length of the EpollEventArray which represent the maximum number of epoll_events that can be stored in it.

pack-priv long
memoryAddress()

Return the memoryAddress which points to the start of this EpollEventArray.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EPOLL_DATA_OFFSETback to summary
private static final int EPOLL_DATA_OFFSET
EPOLL_EVENT_SIZEback to summary
private static final int EPOLL_EVENT_SIZE
lengthback to summary
private int length
memoryback to summary
private ByteBuffer memory
memoryAddressback to summary
private long memoryAddress

Constructor Detail

EpollEventArrayback to summary
pack-priv EpollEventArray(int length)

Method Detail

calculateBufferCapacityback to summary
private static int calculateBufferCapacity(int capacity)
eventsback to summary
pack-priv int events(int index)

Return the events for the epoll_event on this index.

fdback to summary
pack-priv int fd(int index)

Return the file descriptor for the epoll_event on this index.

freeback to summary
pack-priv void free()

Free this EpollEventArray. Any usage after calling this method may segfault the JVM!

getIntback to summary
private int getInt(int index, int offset)
increaseback to summary
pack-priv void increase()

Increase the storage of this EpollEventArray.

lengthback to summary
pack-priv int length()

Return the length of the EpollEventArray which represent the maximum number of epoll_events that can be stored in it.

memoryAddressback to summary
pack-priv long memoryAddress()

Return the memoryAddress which points to the start of this EpollEventArray.