Top Description Fields Constructors Methods
org.eclipse.jetty.io

public Class SocketChannelEndPoint

extends SelectableChannelEndPoint
Class Inheritance
Known Direct Subclasses
org.eclipse.jetty.io.NetworkTrafficSocketChannelEndPoint
Imports
java.io.IOException, java.net.SocketAddress, java.nio.ByteBuffer, java.nio.channels.SelectionKey, .SocketChannel, org.eclipse.jetty.util.BufferUtil, org.eclipse.jetty.util.thread.Scheduler, org.slf4j.Logger, .LoggerFactory

An EndPoint implementation based on SocketChannel.

Field Summary

Modifier and TypeField and Description
private static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
public int
fill(ByteBuffer
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.
buffer
)

Overrides default org.eclipse.jetty.io.EndPoint.fill.

Fill the passed buffer with data from this endpoint.

public boolean
flush(ByteBuffer...
the buffers to flush
buffers
)

Overrides default org.eclipse.jetty.io.EndPoint.flush.

Flush data from the passed header/buffer to this endpoint.

public SocketChannel
public SocketAddress
Inherited from org.eclipse.jetty.io.SelectableChannelEndPoint:
doClosegetLocalSocketAddressgetTransportisOpenneedsFillInterestonCloseonIncompleteFlushonSelectedreplaceKeytoEndPointStringupdateKey

Field Detail

LOGback to summary
private static final Logger LOG

Hides org.eclipse.jetty.io.SelectableChannelEndPoint.LOG.

Constructor Detail

SocketChannelEndPointback to summary
public SocketChannelEndPoint(SocketChannel channel, ManagedSelector selector, SelectionKey key, Scheduler scheduler)

Method Detail

doShutdownOutputback to summary
protected void doShutdownOutput()

Overrides org.eclipse.jetty.io.AbstractEndPoint.doShutdownOutput.

Annotations
@Override
fillback to summary
public int fill(ByteBuffer buffer) throws IOException

Overrides default org.eclipse.jetty.io.EndPoint.fill.

Doc from org.eclipse.jetty.io.EndPoint.fill.

Fill the passed buffer with data from this endpoint. The bytes are appended to any data already in the buffer by writing from the buffers limit up to it's capacity. The limit is updated to include the filled bytes.

Parameters
buffer:ByteBuffer

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.

Returns:int

an int value indicating the number of bytes filled or -1 if EOF is read or the input is shutdown.

Annotations
@Override
Exceptions
IOException:
if the endpoint is closed.
flushback to summary
public boolean flush(ByteBuffer... buffers) throws IOException

Overrides default org.eclipse.jetty.io.EndPoint.flush.

Doc from org.eclipse.jetty.io.EndPoint.flush.

Flush data from the passed header/buffer to this endpoint. As many bytes as can be consumed are taken from the header/buffer position up until the buffer limit. The header/buffers position is updated to indicate how many bytes have been consumed.

Parameters
buffers:ByteBuffer[]

the buffers to flush

Returns:boolean

True IFF all the buffers have been consumed and the endpoint has flushed the data to its destination (ie is not buffering any data).

Annotations
@Override
Exceptions
IOException:
If the endpoint is closed or output is shutdown.
getChannelback to summary
public SocketChannel getChannel()

Overrides org.eclipse.jetty.io.SelectableChannelEndPoint.getChannel.

Annotations
@Override
getRemoteSocketAddressback to summary
public SocketAddress getRemoteSocketAddress()

Overrides default org.eclipse.jetty.io.EndPoint.getRemoteSocketAddress.

Implements abstract org.eclipse.jetty.io.AbstractEndPoint.getRemoteSocketAddress.

Returns:SocketAddress

Doc from org.eclipse.jetty.io.EndPoint.getRemoteSocketAddress.

The remote SocketAddress to which this EndPoint is connected, or null if this EndPoint is not connected to a Socket address.

Annotations
@Override