Class Quiche
java.lang.Object
org.eclipse.jetty.quic.quiche.Quiche
- Direct Known Subclasses:
 ForeignQuicheConnection, JnaQuicheConnection
Provides Java APIs to access the native Quiche library.
The access is performed via a QuicheBinding, depending
on the implementation used to access the native Quiche library.
- 
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic interfacestatic classstatic interface - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionabstract booleanstatic Quicheconnect(QuicheConfig quicheConfig, InetSocketAddress local, InetSocketAddress peer) static Quicheconnect(QuicheConfig quicheConfig, InetSocketAddress local, InetSocketAddress peer, int connectionIdLength) abstract voiddispose()abstract intdrainCipherBytes(ByteBuffer buffer) Fill the given buffer with cipher text to be sent.abstract intdrainClearBytesForStream(long streamId, ByteBuffer buffer, boolean[] last) abstract intfeedCipherBytes(ByteBuffer buffer, SocketAddress local, SocketAddress peer) Read the buffer of cipher text coming from the network.final intfeedClearBytesForStream(long streamId, ByteBuffer buffer) abstract intfeedClearBytesForStream(long streamId, ByteBuffer buffer, boolean last) final voidfeedFinForStream(long streamId) abstract Quiche.CloseInfoabstract Stringabstract byte[]abstract Quiche.CloseInfoabstract booleanabstract booleanabstract booleanabstract booleanisStreamFinished(long streamId) iterableStreamIds(boolean write) abstract intstatic booleannegotiate(Quiche.TokenMinter tokenMinter, ByteBuffer packetRead, ByteBuffer packetToSend) Fully consumes thepacketReadbuffer.abstract longabstract voidstatic byte[]probeConnectionId(ByteBuffer packet) abstract voidshutdownStream(long streamId, boolean writeSide, long error) static InetSocketAddresstoInetSocketAddress(SocketAddress address, boolean client) static QuichetryAccept(QuicheConfig quicheConfig, Quiche.TokenValidator tokenValidator, ByteBuffer packetRead, SocketAddress local, SocketAddress peer) Fully consumes thepacketReadbuffer if the connection was accepted.abstract longabstract longwindowCapacity(long streamId)  
- 
Constructor Details
- 
Quiche
public Quiche() 
 - 
 - 
Method Details
- 
toInetSocketAddress
 - 
probeConnectionId
 - 
connect
public static Quiche connect(QuicheConfig quicheConfig, InetSocketAddress local, InetSocketAddress peer) throws IOException - Throws:
 IOException
 - 
connect
public static Quiche connect(QuicheConfig quicheConfig, InetSocketAddress local, InetSocketAddress peer, int connectionIdLength) throws IOException - Throws:
 IOException
 - 
negotiate
public static boolean negotiate(Quiche.TokenMinter tokenMinter, ByteBuffer packetRead, ByteBuffer packetToSend) throws IOException Fully consumes thepacketReadbuffer.- Returns:
 - true if a negotiation packet was written to the 
packetToSendbuffer, false if negotiation failed and thepacketReadbuffer can be dropped. - Throws:
 IOException
 - 
tryAccept
public static Quiche tryAccept(QuicheConfig quicheConfig, Quiche.TokenValidator tokenValidator, ByteBuffer packetRead, SocketAddress local, SocketAddress peer) throws IOException Fully consumes thepacketReadbuffer if the connection was accepted.- Returns:
 - an established connection if accept succeeded, null if accept failed and negotiation should be tried.
 - Throws:
 IOException
 - 
readableStreamIds
 - 
writableStreamIds
 - 
iterableStreamIds
 - 
feedCipherBytes
public abstract int feedCipherBytes(ByteBuffer buffer, SocketAddress local, SocketAddress peer) throws IOException Read the buffer of cipher text coming from the network.- Parameters:
 buffer- the buffer to read.local- the local address on which the buffer was received.peer- the address of the peer from which the buffer was received.- Returns:
 - how many bytes were consumed.
 - Throws:
 IOException
 - 
drainCipherBytes
Fill the given buffer with cipher text to be sent.- Parameters:
 buffer- the buffer to fill.- Returns:
 - how many bytes were added to the buffer.
 - Throws:
 IOException
 - 
isConnectionClosed
public abstract boolean isConnectionClosed() - 
isConnectionEstablished
public abstract boolean isConnectionEstablished() - 
nextTimeout
public abstract long nextTimeout() - 
onTimeout
public abstract void onTimeout() - 
getNegotiatedProtocol
 - 
close
 - 
dispose
public abstract void dispose() - 
isDraining
public abstract boolean isDraining() - 
maxLocalStreams
public abstract int maxLocalStreams() - 
windowCapacity
public abstract long windowCapacity() - 
windowCapacity
- Throws:
 IOException
 - 
shutdownStream
public abstract void shutdownStream(long streamId, boolean writeSide, long error) throws IOException - Throws:
 IOException
 - 
feedFinForStream
- Throws:
 IOException
 - 
feedClearBytesForStream
- Throws:
 IOException
 - 
feedClearBytesForStream
public abstract int feedClearBytesForStream(long streamId, ByteBuffer buffer, boolean last) throws IOException - Throws:
 IOException
 - 
drainClearBytesForStream
public abstract int drainClearBytesForStream(long streamId, ByteBuffer buffer, boolean[] last) throws IOException - Throws:
 IOException
 - 
isStreamFinished
public abstract boolean isStreamFinished(long streamId) - Parameters:
 streamId- the stream id- Returns:
 - whether all the data has been read from the specified stream.
 
 - 
getRemoteCloseInfo
 - 
getLocalCloseInfo
 - 
getPeerCertificate
public abstract byte[] getPeerCertificate() 
 -