|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.khelekore.rnio.impl.SocketHandlerBase<SocketChannel>
org.khelekore.rnio.impl.SimpleBlockSender
public abstract class SimpleBlockSender
A simple sender of data. Will try to send all data with no timeout.
Subclass this sender and implement done() to do any
work after the data has been sent.
| Field Summary |
|---|
| Fields inherited from class org.khelekore.rnio.impl.SocketHandlerBase |
|---|
nioHandler, sc, timeout |
| Constructor Summary | |
|---|---|
SimpleBlockSender(SocketChannel sc,
NioHandler nioHandler,
ByteBuffer buf,
Long timeout)
|
|
| Method Summary | |
|---|---|
void |
done()
The default is to do nothing, override in subclasses if needed. |
ByteBuffer |
getBuffer()
Get the buffer we are sending data from. |
void |
handleIOException(IOException e)
Handle the exception, default is to log it and to close the channel. |
void |
register()
Register writeWait on the nioHandler |
void |
write()
The channel is ready for read. |
| Methods inherited from class org.khelekore.rnio.impl.SocketHandlerBase |
|---|
closed, getDescription, getTimeout, timeout, useSeparateThread |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.khelekore.rnio.SocketChannelHandler |
|---|
closed, getDescription, getTimeout, timeout, useSeparateThread |
| Constructor Detail |
|---|
public SimpleBlockSender(SocketChannel sc,
NioHandler nioHandler,
ByteBuffer buf,
Long timeout)
sc - the channel to handlenioHandler - the NioHandlerbuf - the ByteBuffer to sendtimeout - the timeout in millis, may be null if no timeout
is wanted.| Method Detail |
|---|
public ByteBuffer getBuffer()
public void write()
WriteHandler
write in interface WriteHandlerpublic void handleIOException(IOException e)
public void done()
public void register()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||