Package com.barchart.udt
Class EpollUDT
java.lang.Object
com.barchart.udt.EpollUDT
UDT Epoll Manager
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intprotected booleanprotected static final org.slf4j.Loggerprivate final SocketUDTplace holder socket to work around logic in epoll.h CEPoll::wait() which expects at least one socket being monitored with non empty interest -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(SocketUDT socket, EpollUDT.Opt option) register socket into event processing pollvoiddestroy()deallocate poll; called onfinalize()protected voidfinalize()deallocate pollintid()poll descriptor idbooleanisActive()poll becomes active after instance creation and inactive afterdestroy()voidunregister socket from event processing pollvoidupdate(SocketUDT socket, EpollUDT.Opt option) update existing poll/socket registration with changed interestreport current poll/socket readiness
-
Field Details
-
log
protected static final org.slf4j.Logger log -
id
protected final int id -
isActive
protected volatile boolean isActive -
socketUDT
place holder socket to work around logic in epoll.h CEPoll::wait() which expects at least one socket being monitored with non empty interest
-
-
Constructor Details
-
EpollUDT
allocate poll- Throws:
ExceptionUDT
-
-
Method Details
-
destroy
deallocate poll; called onfinalize()- Throws:
ExceptionUDT
-
id
public int id()poll descriptor id -
isActive
public boolean isActive()poll becomes active after instance creation and inactive afterdestroy() -
finalize
protected void finalize()deallocate pollNOTE: catch all exceptions; else prevents GC
NOTE: do not leak "this" references; else prevents GC
-
add
register socket into event processing poll- Throws:
ExceptionUDT
-
remove
unregister socket from event processing poll- Throws:
ExceptionUDT
-
update
update existing poll/socket registration with changed interest- Throws:
ExceptionUDT
-
verify
report current poll/socket readiness- Throws:
ExceptionUDT
-