Class SocketChannelEndPoint
java.lang.Object
org.eclipse.jetty.io.IdleTimeout
org.eclipse.jetty.io.AbstractEndPoint
org.eclipse.jetty.io.SelectableChannelEndPoint
org.eclipse.jetty.io.SocketChannelEndPoint
- All Implemented Interfaces:
Closeable, AutoCloseable, EndPoint, ManagedSelector.Selectable
- Direct Known Subclasses:
NetworkTrafficSocketChannelEndPoint
An EndPoint implementation based on SocketChannel.
-
Nested Class Summary
Nested classes/interfaces inherited from interface EndPoint
EndPoint.Pipe, EndPoint.SslSessionData, EndPoint.Wrapper -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionSocketChannelEndPoint(SocketChannel channel, ManagedSelector selector, SelectionKey key, Scheduler scheduler) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidintfill(ByteBuffer buffer) Fills the passed buffer with data from this endpoint.booleanflush(ByteBuffer... buffers) Flushes data from the passed header/buffer to this endpoint.Methods inherited from class SelectableChannelEndPoint
doClose, getLocalSocketAddress, getTransport, isOpen, needsFillInterest, onClose, onIncompleteFlush, onSelected, replaceKey, toEndPointString, updateKeyMethods inherited from class AbstractEndPoint
close, close, doShutdownInput, fillInterested, getConnection, getCreatedTimeStamp, getFillInterest, getLocalAddress, getRemoteAddress, getWriteFlusher, isFillInterested, isInputShutdown, isOutputShutdown, onClose, onIdleExpired, onOpen, reset, setConnection, shutdownInput, shutdownOutput, toConnectionString, toString, tryFillInterested, upgrade, writeMethods inherited from class IdleTimeout
checkIdleTimeout, getIdleFor, getIdleTimeout, getScheduler, notIdle, setIdleTimeoutMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface EndPoint
getIdleTimeout, getSslSessionData, isSecure, receive, send, setIdleTimeout, write
-
Constructor Details
-
SocketChannelEndPoint
public SocketChannelEndPoint(SocketChannel channel, ManagedSelector selector, SelectionKey key, Scheduler scheduler)
-
-
Method Details
-
getChannel
- Overrides:
getChannelin classSelectableChannelEndPoint
-
getRemoteSocketAddress
- Specified by:
getRemoteSocketAddressin interfaceEndPoint- Specified by:
getRemoteSocketAddressin classAbstractEndPoint- Returns:
- The remote SocketAddress to which this
EndPointis connected, ornullif thisEndPointis not connected to a Socket address.
-
doShutdownOutput
protected void doShutdownOutput()- Overrides:
doShutdownOutputin classAbstractEndPoint
-
fill
Description copied from interface:EndPointFills 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 its capacity. The limit is updated to include the filled bytes.
- Parameters:
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.- Returns:
- an
intvalue indicating the number of bytes filled or -1 if EOF is read or the input is shutdown. - Throws:
IOException- if the endpoint is closed.
-
flush
Description copied from interface:EndPointFlushes 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- the buffers to flush- Returns:
- True IFF all the buffers have been consumed and the endpoint has flushed the data to its destination (ie is not buffering any data).
- Throws:
IOException- If the endpoint is closed or output is shutdown.
-