public class NetworkTrafficSelectChannelEndPoint extends SelectChannelEndPoint
Constructor and Description |
---|
NetworkTrafficSelectChannelEndPoint(SocketChannel channel,
SelectorManager.ManagedSelector selectSet,
SelectionKey key,
Scheduler scheduler,
long idleTimeout,
List<NetworkTrafficListener> listeners) |
Modifier and Type | Method and Description |
---|---|
int |
fill(ByteBuffer buffer)
Fill the passed buffer with data from this endpoint.
|
boolean |
flush(ByteBuffer... buffers)
Flush data from the passed header/buffer to this endpoint.
|
void |
notifyClosed() |
void |
notifyIncoming(ByteBuffer buffer,
int read) |
void |
notifyOpened() |
void |
notifyOutgoing(ByteBuffer buffer,
int position,
int written) |
close, isOpen, needsFill, onIncompleteFlush, onOpen, onSelected, toString
getChannel, getSocket, getTransport, isInputShutdown, isOutputShutdown, shutdownInput, shutdownOutput
fillInterested, getConnection, getCreatedTimeStamp, getFillInterest, getLocalAddress, getRemoteAddress, getWriteFlusher, onClose, onIdleExpired, setConnection, write
checkIdleTimeout, getIdleTimeout, getIdleTimestamp, notIdle, setIdleTimeout
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
fillInterested, getConnection, getCreatedTimeStamp, getIdleTimeout, getLocalAddress, getRemoteAddress, getTransport, isInputShutdown, isOutputShutdown, onClose, setConnection, setIdleTimeout, shutdownOutput, write
public NetworkTrafficSelectChannelEndPoint(SocketChannel channel, SelectorManager.ManagedSelector selectSet, SelectionKey key, Scheduler scheduler, long idleTimeout, List<NetworkTrafficListener> listeners) throws IOException
IOException
public int fill(ByteBuffer buffer) throws IOException
EndPoint
fill
in interface EndPoint
fill
in class ChannelEndPoint
buffer
- The buffer to fill. The position and limit are modified during the fill. After the
operation, the position is unchanged and the limit is increased to reflect the new data filled.int
value indicating the number of bytes
filled or -1 if EOF is read or the input is shutdown.EofException
- If the endpoint is closed.IOException
public boolean flush(ByteBuffer... buffers) throws IOException
EndPoint
flush
in interface EndPoint
flush
in class ChannelEndPoint
EofException
- If the endpoint is closed or output is shutdown.IOException
public void notifyOpened()
public void notifyIncoming(ByteBuffer buffer, int read)
public void notifyOutgoing(ByteBuffer buffer, int position, int written)
public void notifyClosed()
Copyright © 1995-2014 Mort Bay Consulting. All Rights Reserved.