Class QuicStreamEndPoint
- All Implemented Interfaces:
Closeable, AutoCloseable, EndPoint
An EndPoint implementation on top of a QUIC stream.
The correspondent Connection associated to this QuicStreamEndPoint
parses and generates the protocol specific bytes transported by QUIC.
-
Nested Class Summary
Nested classes/interfaces inherited from interface EndPoint
EndPoint.Pipe, EndPoint.SslSessionData, EndPoint.Wrapper -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidintfill(ByteBuffer buffer) Fills the passed buffer with data from this endpoint.voidfillInterested(Callback callback) Requests callback methods to be invoked when a call toEndPoint.fill(ByteBuffer)would return data or EOF.booleanflush(ByteBuffer... buffers) Flushes data from the passed header/buffer to this endpoint.Returns the SslSessionData of a secure end point.longbooleanprotected voidvoidCallback method invoked when thisEndPointis closed.protected voidbooleanvoidvoidopened()voidshutdownInput(long error) voidshutdownOutput(long error) toString()booleantryFillInterested(Callback callback) Requests callback methods to be invoked when a call toEndPoint.fill(ByteBuffer)would return data or EOF.voidwrite(Callback callback, List<ByteBuffer> buffers, boolean last) Methods inherited from class AbstractEndPoint
close, close, doClose, doShutdownInput, doShutdownOutput, getConnection, getCreatedTimeStamp, getFillInterest, getLocalAddress, getRemoteAddress, getWriteFlusher, isFillInterested, isInputShutdown, isOpen, isOutputShutdown, onClose, onIdleExpired, onOpen, reset, setConnection, shutdownInput, shutdownOutput, toConnectionString, toEndPointString, 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, isSecure, receive, send, setIdleTimeout, write
-
Constructor Details
-
QuicStreamEndPoint
-
-
Method Details
-
opened
public void opened() -
closed
-
getQuicSession
-
getStreamId
public long getStreamId() -
getLocalSocketAddress
- Specified by:
getLocalSocketAddressin interfaceEndPoint- Specified by:
getLocalSocketAddressin classAbstractEndPoint- Returns:
- the local SocketAddress to which this
EndPointis bound ornullif thisEndPointis not bound to a Socket address.
-
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.
-
isStreamFinished
public boolean isStreamFinished() -
shutdownInput
public void shutdownInput(long error) -
shutdownOutput
public void shutdownOutput(long error) -
close
-
onClose
-
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.
-
write
-
getTransport
- Returns:
- The underlying transport object (socket, channel, etc.)
-
getSslSessionData
Description copied from interface:EndPointReturns the SslSessionData of a secure end point.
- Returns:
- A
EndPoint.SslSessionDatainstance (with possibly null field values) if secure, elsenull.
-
onWritable
public void onWritable() -
onReadable
public boolean onReadable()- Returns:
- whether this endPoint is interested in reads
-
fillInterested
Description copied from interface:EndPointRequests callback methods to be invoked when a call to
EndPoint.fill(ByteBuffer)would return data or EOF.- Specified by:
fillInterestedin interfaceEndPoint- Overrides:
fillInterestedin classAbstractEndPoint- Parameters:
callback- the callback to call when an error occurs or we are readable. The callback may implement theInvocableinterface to self declare its blocking status. Non-blocking callbacks may be called more efficiently without dispatch delays.
-
tryFillInterested
Description copied from interface:EndPointRequests callback methods to be invoked when a call to
EndPoint.fill(ByteBuffer)would return data or EOF.- Specified by:
tryFillInterestedin interfaceEndPoint- Overrides:
tryFillInterestedin classAbstractEndPoint- Parameters:
callback- the callback to call when an error occurs or we are readable. The callback may implement theInvocableinterface to self declare its blocking status. Non-blocking callbacks may be called more efficiently without dispatch delays.- Returns:
- true if set
-
onIncompleteFlush
protected void onIncompleteFlush()- Specified by:
onIncompleteFlushin classAbstractEndPoint
-
needsFillInterest
protected void needsFillInterest()- Specified by:
needsFillInterestin classAbstractEndPoint
-
toString
- Overrides:
toStringin classAbstractEndPoint
-