Constructor and Description |
---|
EventPumper(RouterContext ctx,
NTCPTransport transport) |
Modifier and Type | Method and Description |
---|---|
void |
blockIP(byte[] ip)
Temp.
|
static void |
clearInterest(SelectionKey key,
int op)
Warning - caller should catch unchecked CancelledKeyException
|
long |
getIdleTimeout() |
boolean |
isAlive()
Selector can take quite a while to close after calling stopPumping()
|
boolean |
processWrite(NTCPConnection con,
SelectionKey key)
Asynchronous write all buffers to the channel.
|
void |
register(ServerSocketChannel chan)
Register the acceptor.
|
void |
registerConnect(NTCPConnection con)
Outbound
|
static void |
releaseBuf(ByteBuffer buf)
Return a read buffer to the pool.
|
void |
run()
The selector loop.
|
static void |
setInterest(SelectionKey key,
int op)
Warning - caller should catch unchecked CancelledKeyException
|
void |
startPumping() |
void |
stopPumping() |
void |
wantsRead(NTCPConnection con)
This is only called from NTCPConnection.complete()
if there is more data, which is rare (never?)
so we don't need to check for dups or make _wantsRead a Set.
|
void |
wantsWrite(NTCPConnection con)
Called by the connection when it has data ready to write (after bw allocation).
|
public EventPumper(RouterContext ctx, NTCPTransport transport)
public void startPumping()
public void stopPumping()
public boolean isAlive()
public void register(ServerSocketChannel chan)
public void registerConnect(NTCPConnection con)
public void run()
public void wantsWrite(NTCPConnection con)
public void wantsRead(NTCPConnection con)
public static void releaseBuf(ByteBuffer buf)
public boolean processWrite(NTCPConnection con, SelectionKey key)
key
- non-nullpublic void blockIP(byte[] ip)
public long getIdleTimeout()
public static void setInterest(SelectionKey key, int op) throws CancelledKeyException
CancelledKeyException
- which is uncheckedpublic static void clearInterest(SelectionKey key, int op) throws CancelledKeyException
CancelledKeyException
- which is unchecked