public class NIOLooper extends WakeableLooper
loop()
Constructor and Description |
---|
NIOLooper() |
Modifier and Type | Method and Description |
---|---|
void |
doWait() |
boolean |
isAcceptRegistered(java.nio.channels.SelectableChannel channel) |
boolean |
isChannelValid(java.nio.channels.SelectableChannel channel) |
boolean |
isConnectRegistered(java.nio.channels.SelectableChannel channel) |
boolean |
isReadRegistered(java.nio.channels.SelectableChannel channel) |
boolean |
isWriteRegistered(java.nio.channels.SelectableChannel channel) |
void |
registerAccept(java.nio.channels.SelectableChannel channel,
ISelectHandler callback) |
void |
registerConnect(java.nio.channels.SelectableChannel channel,
ISelectHandler callback) |
void |
registerRead(java.nio.channels.SelectableChannel channel,
ISelectHandler callback)
Followings are the register, unregister, isRegister for different operations for the selector and channel
|
void |
registerWrite(java.nio.channels.SelectableChannel channel,
ISelectHandler callback) |
void |
removeAllInterest(java.nio.channels.SelectableChannel channel) |
void |
unregisterAccept(java.nio.channels.SelectableChannel channel) |
void |
unregisterConnect(java.nio.channels.SelectableChannel channel) |
void |
unregisterRead(java.nio.channels.SelectableChannel channel) |
void |
unregisterWrite(java.nio.channels.SelectableChannel channel) |
void |
wakeUp() |
addTasksOnExit, addTasksOnWakeup, exitLoop, getNextTimeoutIntervalMs, loop, registerTimerEventInNanoSeconds, registerTimerEventInSeconds
public NIOLooper() throws java.io.IOException
java.io.IOException
public void doWait()
doWait
in class WakeableLooper
public void wakeUp()
wakeUp
in class WakeableLooper
public void removeAllInterest(java.nio.channels.SelectableChannel channel)
public boolean isChannelValid(java.nio.channels.SelectableChannel channel)
public void registerRead(java.nio.channels.SelectableChannel channel, ISelectHandler callback) throws java.nio.channels.ClosedChannelException
java.nio.channels.ClosedChannelException
public void unregisterRead(java.nio.channels.SelectableChannel channel)
public boolean isReadRegistered(java.nio.channels.SelectableChannel channel)
public void registerConnect(java.nio.channels.SelectableChannel channel, ISelectHandler callback) throws java.nio.channels.ClosedChannelException
java.nio.channels.ClosedChannelException
public void unregisterConnect(java.nio.channels.SelectableChannel channel)
public boolean isConnectRegistered(java.nio.channels.SelectableChannel channel)
public void registerAccept(java.nio.channels.SelectableChannel channel, ISelectHandler callback) throws java.nio.channels.ClosedChannelException
java.nio.channels.ClosedChannelException
public void unregisterAccept(java.nio.channels.SelectableChannel channel)
public boolean isAcceptRegistered(java.nio.channels.SelectableChannel channel)
public void registerWrite(java.nio.channels.SelectableChannel channel, ISelectHandler callback) throws java.nio.channels.ClosedChannelException
java.nio.channels.ClosedChannelException
public void unregisterWrite(java.nio.channels.SelectableChannel channel)
public boolean isWriteRegistered(java.nio.channels.SelectableChannel channel)