public class NamedChannelWithTimeout extends NamedChannel
channel
Constructor and Description |
---|
NamedChannelWithTimeout(RepNode repNode,
java.nio.channels.SocketChannel channel,
int timeoutMs) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
isActive(long timeMs)
Method invoked by the time thread to check on the channel on a periodic
basis.
|
int |
read(java.nio.ByteBuffer dst) |
void |
setTimeoutMs(int timeoutMs)
Used to modify the timeout associated with the channel.
|
getChannel, getNameIdPair, isOpen, setNameIdPair, toString, write
public NamedChannelWithTimeout(RepNode repNode, java.nio.channels.SocketChannel channel, int timeoutMs)
public void setTimeoutMs(int timeoutMs)
timeoutMs
- the new timeout valuepublic int read(java.nio.ByteBuffer dst) throws java.io.IOException
read
in interface java.nio.channels.ReadableByteChannel
read
in class NamedChannel
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in interface java.nio.channels.Channel
close
in class NamedChannel
java.io.IOException
public boolean isActive(long timeMs)
timeMs
- the pseudo timeCopyright (c) 2004-2012 Oracle. All rights reserved.