Top Inners Fields Constructors Methods
org.eclipse.jetty.quic.quiche

public abstract Class QuicheConnection

extends Object
Class Inheritance
Imports
java.io.IOException, java.net.InetSocketAddress, .SocketAddress, java.nio.ByteBuffer, java.util.Comparator, .List, .ServiceLoader, java.util.stream.Collectors, org.eclipse.jetty.util.BufferUtil, .TypeUtil, org.slf4j.Logger, .LoggerFactory

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static interface
public static class
public static interface

Field Summary

Modifier and TypeField and Description
private static final Logger
pack-priv static final QuicheBinding

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract boolean
close(long error, String reason)

public static QuicheConnection
public static QuicheConnection
connect(QuicheConfig quicheConfig, InetSocketAddress local, InetSocketAddress peer, int connectionIdLength)

public abstract void
public abstract int

Returns:

how many bytes were added to the buffer.
drainCipherBytes
(ByteBuffer
the buffer to fill.
buffer
)

Fill the given buffer with cipher text to be sent.

public abstract int
drainClearBytesForStream(long streamId, ByteBuffer buffer)

public abstract int

Returns:

how many bytes were consumed.
feedCipherBytes
(ByteBuffer
the buffer to read.
buffer
,
SocketAddress
the local address on which the buffer was received.
local
,
SocketAddress
the address of the peer from which the buffer was received.
peer
)

Read the buffer of cipher text coming from the network.

public final int
feedClearBytesForStream(long streamId, ByteBuffer buffer)

public abstract int
feedClearBytesForStream(long streamId, ByteBuffer buffer, boolean last)

public final void
feedFinForStream(long streamId)

public abstract QuicheConnection.CloseInfo
public abstract String
public abstract QuicheConnection.CloseInfo
public abstract boolean
public abstract boolean
public abstract boolean
public abstract boolean
isStreamFinished(long streamId)

protected abstract List<Long>
iterableStreamIds(boolean write)

public abstract int
public static boolean

Returns:

true if a negotiation packet was written to the packetToSend buffer, false if negotiation failed and the packetRead buffer can be dropped.
negotiate
(QuicheConnection.TokenMinter tokenMinter, ByteBuffer packetRead, ByteBuffer packetToSend)

Fully consumes the packetRead buffer.

public abstract long
public abstract void
public final List<Long>
public abstract void
shutdownStream(long streamId, boolean writeSide, long error)

public static QuicheConnection

Returns:

an established connection if accept succeeded, null if accept failed and negotiation should be tried.
tryAccept
(QuicheConfig quicheConfig, QuicheConnection.TokenValidator tokenValidator, ByteBuffer packetRead, SocketAddress local, SocketAddress peer)

Fully consumes the packetRead buffer if the connection was accepted.

public abstract long
public abstract long
windowCapacity(long streamId)

public final List<Long>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LOGback to summary
private static final Logger LOG
QUICHE_BINDINGback to summary
pack-priv static final QuicheBinding QUICHE_BINDING

Constructor Detail

QuicheConnectionback to summary
public QuicheConnection()

Method Detail

closeback to summary
public abstract boolean close(long error, String reason)
connectback to summary
public static QuicheConnection connect(QuicheConfig quicheConfig, InetSocketAddress local, InetSocketAddress peer) throws IOException
connectback to summary
public static QuicheConnection connect(QuicheConfig quicheConfig, InetSocketAddress local, InetSocketAddress peer, int connectionIdLength) throws IOException
disposeback to summary
public abstract void dispose()
drainCipherBytesback to summary
public abstract int drainCipherBytes(ByteBuffer buffer) throws IOException

Fill the given buffer with cipher text to be sent.

Parameters
buffer:ByteBuffer

the buffer to fill.

Returns:int

how many bytes were added to the buffer.

drainClearBytesForStreamback to summary
public abstract int drainClearBytesForStream(long streamId, ByteBuffer buffer) throws IOException
feedCipherBytesback to summary
public abstract int feedCipherBytes(ByteBuffer buffer, SocketAddress local, SocketAddress peer) throws IOException

Read the buffer of cipher text coming from the network.

Parameters
buffer:ByteBuffer

the buffer to read.

local:SocketAddress

the local address on which the buffer was received.

peer:SocketAddress

the address of the peer from which the buffer was received.

Returns:int

how many bytes were consumed.

feedClearBytesForStreamback to summary
public final int feedClearBytesForStream(long streamId, ByteBuffer buffer) throws IOException
feedClearBytesForStreamback to summary
public abstract int feedClearBytesForStream(long streamId, ByteBuffer buffer, boolean last) throws IOException
feedFinForStreamback to summary
public final void feedFinForStream(long streamId) throws IOException
getLocalCloseInfoback to summary
public abstract QuicheConnection.CloseInfo getLocalCloseInfo()
getNegotiatedProtocolback to summary
public abstract String getNegotiatedProtocol()
getRemoteCloseInfoback to summary
public abstract QuicheConnection.CloseInfo getRemoteCloseInfo()
isConnectionClosedback to summary
public abstract boolean isConnectionClosed()
isConnectionEstablishedback to summary
public abstract boolean isConnectionEstablished()
isDrainingback to summary
public abstract boolean isDraining()
isStreamFinishedback to summary
public abstract boolean isStreamFinished(long streamId)
iterableStreamIdsback to summary
protected abstract List<Long> iterableStreamIds(boolean write)
maxLocalStreamsback to summary
public abstract int maxLocalStreams()
negotiateback to summary
public static boolean negotiate(QuicheConnection.TokenMinter tokenMinter, ByteBuffer packetRead, ByteBuffer packetToSend) throws IOException

Fully consumes the packetRead buffer.

Returns:boolean

true if a negotiation packet was written to the packetToSend buffer, false if negotiation failed and the packetRead buffer can be dropped.

nextTimeoutback to summary
public abstract long nextTimeout()
onTimeoutback to summary
public abstract void onTimeout()
readableStreamIdsback to summary
public final List<Long> readableStreamIds()
shutdownStreamback to summary
public abstract void shutdownStream(long streamId, boolean writeSide, long error) throws IOException
tryAcceptback to summary
public static QuicheConnection tryAccept(QuicheConfig quicheConfig, QuicheConnection.TokenValidator tokenValidator, ByteBuffer packetRead, SocketAddress local, SocketAddress peer) throws IOException

Fully consumes the packetRead buffer if the connection was accepted.

Returns:QuicheConnection

an established connection if accept succeeded, null if accept failed and negotiation should be tried.

windowCapacityback to summary
public abstract long windowCapacity()
windowCapacityback to summary
public abstract long windowCapacity(long streamId) throws IOException
writableStreamIdsback to summary
public final List<Long> writableStreamIds()
org.eclipse.jetty.quic.quiche back to summary

public Class QuicheConnection.CloseInfo

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final long
private final String

Constructor Summary

AccessConstructor and Description
public
CloseInfo(long error, String reason)

Method Summary

Modifier and TypeMethod and Description
public long
public String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

errorback to summary
private final long error
reasonback to summary
private final String reason

Constructor Detail

CloseInfoback to summary
public CloseInfo(long error, String reason)

Method Detail

errorback to summary
public long error()
reasonback to summary
public String reason()
org.eclipse.jetty.quic.quiche back to summary

public Interface QuicheConnection.TokenMinter


Field Summary

Modifier and TypeField and Description
public static final int

Method Summary

Modifier and TypeMethod and Description
public byte[]
mint(byte[] dcid, int len)

Field Detail

MAX_TOKEN_LENGTHback to summary
public static final int MAX_TOKEN_LENGTH

Method Detail

mintback to summary
public byte[] mint(byte[] dcid, int len)
org.eclipse.jetty.quic.quiche back to summary

public Class QuicheConnection.TokenValidationException

extends IOException
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Constructor Detail

TokenValidationExceptionback to summary
public TokenValidationException(String msg)
org.eclipse.jetty.quic.quiche back to summary

public Interface QuicheConnection.TokenValidator


Method Summary

Modifier and TypeMethod and Description
public byte[]
validate(byte[] token, int len)

Method Detail

validateback to summary
public byte[] validate(byte[] token, int len)