@Override protected SelectChannelEndPoint newEndPoint(SocketChannel channel, SelectorManager.SelectSet selectSet, SelectionKey key) throws IOException { NetworkTrafficSelectChannelEndPoint endPoint = new NetworkTrafficSelectChannelEndPoint(channel, selectSet, key, _maxIdleTime, listeners); endPoint.setConnection(selectSet.getManager().newConnection(channel,endPoint, key.attachment())); endPoint.notifyOpened(); return endPoint; }
@Override protected void endPointClosed(SelectChannelEndPoint endpoint) { super.endPointClosed(endpoint); ((NetworkTrafficSelectChannelEndPoint)endpoint).notifyClosed(); } }
@Override public int fill(Buffer buffer) throws IOException { int read = super.fill(buffer); notifyIncoming(buffer, read); return read; }
@Override protected int gatheringFlush(Buffer header, ByteBuffer bbuf0, Buffer buffer, ByteBuffer bbuf1) throws IOException { int headerPosition = header.getIndex(); int headerLength = header.length(); int bufferPosition = buffer.getIndex(); int written = super.gatheringFlush(header, bbuf0, buffer,bbuf1); notifyOutgoing(header, headerPosition, written > headerLength ? headerLength : written); notifyOutgoing(buffer, bufferPosition, written > headerLength ? written - headerLength : 0); return written; }
@Override public int flush(Buffer buffer) throws IOException { int position = buffer.getIndex(); int written = super.flush(buffer); notifyOutgoing(buffer, position, written); return written; }
@Override protected SelectChannelEndPoint newEndPoint(SocketChannel channel, SelectorManager.SelectSet selectSet, SelectionKey key) throws IOException { NetworkTrafficSelectChannelEndPoint endPoint = new NetworkTrafficSelectChannelEndPoint(channel, selectSet, key, _maxIdleTime, listeners); endPoint.setConnection(selectSet.getManager().newConnection(channel,endPoint, key.attachment())); endPoint.notifyOpened(); return endPoint; }
@Override protected int gatheringFlush(Buffer header, ByteBuffer bbuf0, Buffer buffer, ByteBuffer bbuf1) throws IOException { int headerPosition = header.getIndex(); int headerLength = header.length(); int bufferPosition = buffer.getIndex(); int written = super.gatheringFlush(header, bbuf0, buffer,bbuf1); notifyOutgoing(header, headerPosition, written > headerLength ? headerLength : written); notifyOutgoing(buffer, bufferPosition, written > headerLength ? written - headerLength : 0); return written; }
@Override protected void endPointClosed(SelectChannelEndPoint endpoint) { super.endPointClosed(endpoint); ((NetworkTrafficSelectChannelEndPoint)endpoint).notifyClosed(); } }
@Override public int fill(Buffer buffer) throws IOException { int read = super.fill(buffer); notifyIncoming(buffer, read); return read; }
@Override protected SelectChannelEndPoint newEndPoint(SocketChannel channel, SelectorManager.SelectSet selectSet, SelectionKey key) throws IOException { NetworkTrafficSelectChannelEndPoint endPoint = new NetworkTrafficSelectChannelEndPoint(channel, selectSet, key, _maxIdleTime, listeners); endPoint.setConnection(selectSet.getManager().newConnection(channel,endPoint, key.attachment())); endPoint.notifyOpened(); return endPoint; }
@Override public int flush(Buffer buffer) throws IOException { int position = buffer.getIndex(); int written = super.flush(buffer); notifyOutgoing(buffer, position, written); return written; }
@Override protected void endPointClosed(SelectChannelEndPoint endpoint) { super.endPointClosed(endpoint); ((NetworkTrafficSelectChannelEndPoint)endpoint).notifyClosed(); } }
@Override public int fill(Buffer buffer) throws IOException { int read = super.fill(buffer); notifyIncoming(buffer, read); return read; }
@Override protected SelectChannelEndPoint newEndPoint(SocketChannel channel, SelectorManager.SelectSet selectSet, SelectionKey key) throws IOException { NetworkTrafficSelectChannelEndPoint endPoint = new NetworkTrafficSelectChannelEndPoint(channel, selectSet, key, _maxIdleTime, listeners); endPoint.setConnection(selectSet.getManager().newConnection(channel,endPoint, key.attachment())); endPoint.notifyOpened(); return endPoint; }
@Override public int flush(Buffer buffer) throws IOException { int position = buffer.getIndex(); int written = super.flush(buffer); notifyOutgoing(buffer, position, written); return written; }
@Override protected void endPointClosed(SelectChannelEndPoint endpoint) { super.endPointClosed(endpoint); ((NetworkTrafficSelectChannelEndPoint)endpoint).notifyClosed(); } }
@Override public int fill(Buffer buffer) throws IOException { int read = super.fill(buffer); notifyIncoming(buffer, read); return read; }
@Override protected SelectChannelEndPoint newEndPoint(SocketChannel channel, SelectorManager.SelectSet selectSet, SelectionKey key) throws IOException { NetworkTrafficSelectChannelEndPoint endPoint = new NetworkTrafficSelectChannelEndPoint(channel, selectSet, key, _maxIdleTime, listeners); endPoint.setConnection(selectSet.getManager().newConnection(channel,endPoint, key.attachment())); endPoint.notifyOpened(); return endPoint; }
@Override protected int gatheringFlush(Buffer header, ByteBuffer bbuf0, Buffer buffer, ByteBuffer bbuf1) throws IOException { int headerPosition = header.getIndex(); int headerLength = header.length(); int bufferPosition = buffer.getIndex(); int written = super.gatheringFlush(header, bbuf0, buffer,bbuf1); notifyOutgoing(header, headerPosition, written > headerLength ? headerLength : written); notifyOutgoing(buffer, bufferPosition, written > headerLength ? written - headerLength : 0); return written; }
@Override protected void endPointClosed(SelectChannelEndPoint endpoint) { super.endPointClosed(endpoint); ((NetworkTrafficSelectChannelEndPoint)endpoint).notifyClosed(); } }