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 |
notifyIncoming(ByteBuffer buffer,
int read) |
void |
notifyOutgoing(ByteBuffer view) |
void |
onClose()
Callback method invoked when this
EndPoint is close. |
void |
onOpen()
Callback method invoked when this
EndPoint is opened. |
close, isOpen, needsFill, onIncompleteFlush, onSelected, toString
getChannel, getSocket, getTransport, isInputShutdown, isOutputShutdown, shutdownInput, shutdownOutput
fillInterested, getConnection, getCreatedTimeStamp, getFillInterest, getLocalAddress, getRemoteAddress, getWriteFlusher, 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, 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 onOpen()
EndPoint
Callback method invoked when this EndPoint
is opened.
onOpen
in interface EndPoint
onOpen
in class SelectChannelEndPoint
EndPoint.onClose()
public void onClose()
EndPoint
Callback method invoked when this EndPoint
is close.
onClose
in interface EndPoint
onClose
in class AbstractEndPoint
EndPoint.onOpen()
public void notifyIncoming(ByteBuffer buffer, int read)
public void notifyOutgoing(ByteBuffer view)
Copyright © 1995-2015 Webtide. All Rights Reserved.